[commit: ghc] wip/T14068: Mark `eqString` as `NOINLINE` (b3e2aaf)

git at git.haskell.org git at git.haskell.org
Wed Aug 2 17:05:21 UTC 2017


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

On branch  : wip/T14068
Link       : http://ghc.haskell.org/trac/ghc/changeset/b3e2aafa21283fd42b2606228a54331e07d1fe88/ghc

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

commit b3e2aafa21283fd42b2606228a54331e07d1fe88
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Aug 2 10:53:37 2017 -0400

    Mark `eqString` as `NOINLINE`
    
    so that the built-in rule can still match.
    
    This will be a problem in general: With loopification, recursive
    functions can now inline (yay!) but many people out there probably rely
    on the fact that recursive functions cannot inline (ouch). Hopefully the
    recent warnings in GHC made them fix this before loopification reaches
    them.


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

b3e2aafa21283fd42b2606228a54331e07d1fe88
 libraries/base/GHC/Base.hs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index ffcd7ff..f25a861 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -1053,6 +1053,7 @@ eqString :: String -> String -> Bool
 eqString []       []       = True
 eqString (c1:cs1) (c2:cs2) = c1 == c2 && cs1 `eqString` cs2
 eqString _        _        = False
+{-# NOINLINE eqString #-}
 
 {-# RULES "eqString" (==) = eqString #-}
 -- eqString also has a BuiltInRule in PrelRules.hs:



More information about the ghc-commits mailing list