[commit: ghc] ghc-8.0: Fix a few loose ends from D1795 (e971c03)

git at git.haskell.org git at git.haskell.org
Thu Feb 4 10:46:43 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/e971c03c3a297c07140583eb9299767695b6a635/ghc

>---------------------------------------------------------------

commit e971c03c3a297c07140583eb9299767695b6a635
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.
    
    (cherry picked from commit bbc0ec5733df434878b02f7556a1cc947718a8b1)


>---------------------------------------------------------------

e971c03c3a297c07140583eb9299767695b6a635
 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 fafadc4..fbed330 100644
--- a/docs/users_guide/8.0.1-notes.rst
+++ b/docs/users_guide/8.0.1-notes.rst
@@ -279,6 +279,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