[commit: ghc] master: Do proper depth checking in the flattener to avoid looping. (c1edbdf)
git at git.haskell.org
git at git.haskell.org
Mon Mar 23 16:26:33 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/c1edbdfd9148ad9f74bfe41e76c524f3e775aaaa/ghc
>---------------------------------------------------------------
commit c1edbdfd9148ad9f74bfe41e76c524f3e775aaaa
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date: Mon Mar 23 10:30:19 2015 -0400
Do proper depth checking in the flattener to avoid looping.
This implements (roughly) the plan put forward in comment:14:ticket:7788,
fixing #7788, #8550, #9554, #10139, and addressing concerns raised in #10079.
There are some regressions w.r.t. GHC 7.8, but only with pathological type
families (like F a = F a). This also (hopefully -- don't have a test case)
fixes #10158. Unsolved problems include #10184 and #10185, which are both
known deficiencies of the approach used here.
As part of this change, the plumbing around detecting infinite loops has
changed. Instead of -fcontext-stack and -ftype-function-depth, we now have
one combined -freduction-depth parameter. Setting it to 0 disbales the
check, which is now the recommended way to get (terminating) code to
typecheck in releases. (The number of reduction steps may well change between
minor GHC releases!)
This commit also introduces a new IntWithInf type in BasicTypes
that represents an integer+infinity. This type is used in a few
places throughout the code.
Tests in
indexed-types/should_fail/T7788
indexed-types/should_fail/T8550
indexed-types/should_fail/T9554
indexed-types/should_compile/T10079
indexed-types/should_compile/T10139
typecheck/should_compile/T10184 (expected broken)
typecheck/should_compile/T10185 (expected broken)
This commit also changes performance testsuite numbers, for the better.
>---------------------------------------------------------------
c1edbdfd9148ad9f74bfe41e76c524f3e775aaaa
compiler/basicTypes/BasicTypes.hs | 69 ++-
compiler/main/Constants.hs | 11 +-
compiler/main/DynFlags.hs | 20 +-
compiler/simplCore/SimplMonad.hs | 17 +-
compiler/typecheck/FamInst.hs | 6 +-
compiler/typecheck/TcCanonical.hs | 520 ++++++++-------------
compiler/typecheck/TcErrors.hs | 30 +-
compiler/typecheck/TcEvidence.hs | 2 +-
compiler/typecheck/TcExpr.hs | 2 +-
compiler/typecheck/TcFlatten.hs | 478 ++++++++++++-------
compiler/typecheck/TcInteract.hs | 60 +--
compiler/typecheck/TcRnTypes.hs | 125 ++---
compiler/typecheck/TcSMonad.hs | 151 ++----
compiler/typecheck/TcValidity.hs | 29 +-
docs/users_guide/flags.xml | 10 +-
docs/users_guide/glasgow_exts.xml | 8 +-
testsuite/tests/deriving/should_fail/T4846.stderr | 4 +-
.../tests/indexed-types/should_compile/T10139.hs | 39 ++
.../indexed-types/should_compile/T3208b.stderr | 7 +-
testsuite/tests/indexed-types/should_compile/all.T | 2 +
.../indexed-types/should_fail/NoMatchErr.stderr | 2 +-
.../tests/indexed-types/should_fail/T1897b.stderr | 2 +-
.../tests/indexed-types/should_fail/T2664.stderr | 6 +-
.../tests/indexed-types/should_fail/T4179.stderr | 6 +-
.../tests/indexed-types/should_fail/T5439.stderr | 4 +-
.../tests/indexed-types/should_fail/T7010.stderr | 2 +-
.../tests/indexed-types/should_fail/T7729.stderr | 2 +-
testsuite/tests/indexed-types/should_fail/T7788.hs | 19 +
.../tests/indexed-types/should_fail/T7788.stderr | 10 +
.../tests/indexed-types/should_fail/T7967.stderr | 2 +-
testsuite/tests/indexed-types/should_fail/T8550.hs | 16 +
.../tests/indexed-types/should_fail/T8550.stderr | 11 +
.../tests/indexed-types/should_fail/T9036.stderr | 2 +-
testsuite/tests/indexed-types/should_fail/T9554.hs | 13 +
.../tests/indexed-types/should_fail/T9554.stderr | 22 +
.../tests/indexed-types/should_fail/T9580.stderr | 4 +-
testsuite/tests/indexed-types/should_fail/all.T | 4 +-
testsuite/tests/perf/compiler/T5321FD.hs | 2 +-
testsuite/tests/perf/compiler/T5321Fun.hs | 2 +-
testsuite/tests/perf/compiler/T5837.stderr | 92 +---
testsuite/tests/perf/compiler/T9872a.hs | 2 +-
testsuite/tests/perf/compiler/T9872b.hs | 2 +-
testsuite/tests/perf/compiler/T9872c.hs | 2 +-
testsuite/tests/perf/compiler/T9872d.hs | 1 +
testsuite/tests/perf/compiler/all.T | 15 +-
testsuite/tests/roles/should_fail/Roles10.stderr | 2 +-
testsuite/tests/typecheck/should_compile/T10184.hs | 9 +
testsuite/tests/typecheck/should_compile/T10185.hs | 7 +
.../typecheck/should_compile/TcCoercibleCompile.hs | 43 +-
testsuite/tests/typecheck/should_compile/all.T | 4 +-
.../typecheck/should_fail/ContextStack1.stderr | 9 +-
.../typecheck/should_fail/ContextStack2.stderr | 13 +-
.../typecheck/should_fail/FrozenErrorTests.stderr | 4 +-
testsuite/tests/typecheck/should_fail/T9318.stderr | 2 +-
.../typecheck/should_fail/TcCoercibleFail.stderr | 27 +-
.../typecheck/should_fail/TcCoercibleFail3.stderr | 2 +-
testsuite/tests/typecheck/should_fail/all.T | 4 +-
testsuite/tests/typecheck/should_fail/tcfail201.hs | 2 +-
.../tests/typecheck/should_fail/tcfail201.stderr | 17 +-
59 files changed, 1034 insertions(+), 946 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c1edbdfd9148ad9f74bfe41e76c524f3e775aaaa
More information about the ghc-commits
mailing list