[commit: ghc] master: Fix a few loose ends from D1795 (bbc0ec5)
git at git.haskell.org
git at git.haskell.org
Thu Feb 4 10:14:25 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/bbc0ec5733df434878b02f7556a1cc947718a8b1/ghc
>---------------------------------------------------------------
commit bbc0ec5733df434878b02f7556a1cc947718a8b1
Author: Ben Gamari <ben at smart-cactus.org>
Date: Thu Feb 4 10:46:28 2016 +0100
Fix a few loose ends from D1795
George updated the Diff but I didn't noticed until it was too late.
>---------------------------------------------------------------
bbc0ec5733df434878b02f7556a1cc947718a8b1
compiler/deSugar/Check.hs | 2 +-
compiler/deSugar/DsMonad.hs | 3 ---
docs/users_guide/8.0.1-notes.rst | 8 ++++++++
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index a28e39e..5570ce9 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -1272,7 +1272,7 @@ warnPmIters dflags (DsMatchContext kind loc)
ctxt = pprMatchContext kind
msg is = fsep [ text "Pattern match checker exceeded"
, parens (ppr is), text "iterations in", ctxt <> dot
- , text "(Use fmax-pmcheck-iterations=n"
+ , text "(Use -fmax-pmcheck-iterations=n"
, text "to set the maximun number of iterations to n)" ]
flag_i = wopt Opt_WarnOverlappingPatterns dflags
diff --git a/compiler/deSugar/DsMonad.hs b/compiler/deSugar/DsMonad.hs
index 3d922f6..0d19ff9 100644
--- a/compiler/deSugar/DsMonad.hs
+++ b/compiler/deSugar/DsMonad.hs
@@ -362,9 +362,6 @@ addTmCsDs :: Bag SimpleEq -> DsM a -> DsM a
addTmCsDs tm_cs
= updLclEnv (\env -> env { dsl_tm_cs = unionBags tm_cs (dsl_tm_cs env) })
--- | Check that we have not done more iterations
--- than we are supposed to and inrease the counter
-
-- | Increase the counter for elapsed pattern match check iterations.
-- If the current counter is already over the limit, fail
incrCheckPmIterDs :: DsM ()
diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst
index 10eab70..f537c54 100644
--- a/docs/users_guide/8.0.1-notes.rst
+++ b/docs/users_guide/8.0.1-notes.rst
@@ -287,6 +287,14 @@ Compiler
warns in the case of unused term-level patterns. Both flags are implied by
:ghc-flag:`-W`.
+- Added the :ghc-flag:`-fmax-pmcheck-iterations` to control how many times
+ the pattern match checker iterates. Since coverage checking is exponential
+ in the general case, setting a default number of iterations prevents memory
+ and performance blowups. By default, the number of iterations is set to
+ 10000000 but it can be set to ``n`` with: ``-fmax-pmcheck-iterations=n``.
+ If the set number of iterations is exceeded, an informative warning is
+ issued.
+
- :ghc-flag:`-this-package-key` has been renamed again (hopefully for the last time!)
to :ghc-flag:`-this-unit-id`. The renaming was motivated by the fact that
the identifier you pass to GHC here doesn't have much to do with packages:
More information about the ghc-commits
mailing list