[commit: ghc] wip/T14068: Mark `eqString` as `NOINLINE` (8d7a23a)
git at git.haskell.org
git at git.haskell.org
Fri Jan 5 21:16:16 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T14068
Link : http://ghc.haskell.org/trac/ghc/changeset/8d7a23a8b297a0eeac2a9754561c52bae4733d9a/ghc
>---------------------------------------------------------------
commit 8d7a23a8b297a0eeac2a9754561c52bae4733d9a
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.
>---------------------------------------------------------------
8d7a23a8b297a0eeac2a9754561c52bae4733d9a
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 052f13f..0ff4589 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -1183,6 +1183,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