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

git at git.haskell.org git at git.haskell.org
Wed Aug 2 15:40:53 UTC 2017


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

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

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

commit a809ef6666a193979a997828dcf75f1b9ac3356b
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.


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

a809ef6666a193979a997828dcf75f1b9ac3356b
 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