[commit: ghc] master: Fix an outright error in competesWith (e4114c8)

git at git.haskell.org git at git.haskell.org
Thu Jul 30 10:02:22 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e4114c84857465ff14c27ead3679983ddf5cfe8f/ghc

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

commit e4114c84857465ff14c27ead3679983ddf5cfe8f
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jul 29 16:43:29 2015 +0100

    Fix an outright error in competesWith
    
    competesWith is a very recent function, introduced in:
    
      commit 2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4
      Author: Simon Peyton Jones <simonpj at microsoft.com>
      Date:   Fri Jul 24 12:50:42 2015 +0100
    
          Improve warnings for rules that might not fire


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

e4114c84857465ff14c27ead3679983ddf5cfe8f
 compiler/basicTypes/BasicTypes.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs
index 8bcb0d9..a256ac1 100644
--- a/compiler/basicTypes/BasicTypes.hs
+++ b/compiler/basicTypes/BasicTypes.hs
@@ -1091,7 +1091,7 @@ competesWith AlwaysActive      _                = True
 
 competesWith (ActiveBefore {}) AlwaysActive      = True
 competesWith (ActiveBefore {}) (ActiveBefore {}) = True
-competesWith (ActiveBefore a)  (ActiveAfter b)   = a > b
+competesWith (ActiveBefore a)  (ActiveAfter b)   = a < b
 
 competesWith (ActiveAfter {})  AlwaysActive      = False
 competesWith (ActiveAfter {})  (ActiveBefore {}) = False
@@ -1104,6 +1104,7 @@ See Note [Rules and inlining/other rules] in Desugar.
 
 We say that act1 "competes with" act2 iff
    act1 is active in the phase when act2 *becomes* active
+NB: remember that phases count *down*: 2, 1, 0!
 
 It's too conservative to ensure that the two are never simultaneously
 active.  For example, a rule might be always active, and an inlining



More information about the ghc-commits mailing list