[GHC] #12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30
GHC
ghc-devs at haskell.org
Sat Nov 19 20:55:55 UTC 2016
#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of
http-client-0.4.30
-------------------------------------+-------------------------------------
Reporter: slyfox | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.2
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Description changed by slyfox:
@@ -24,1 +24,1 @@
- breaks pinter-chasing in bytestring package.
+ breaks pointer-chasing in bytestring package.
New description:
GHC version 8.0.1.20161117
{{{#!hs
-- $ cat BodySpec.hs
-- $ ghc --make -O1 -package={base,bytestring} BodySpec.hs -o a && ./a
{- # OPTIONS_GHC -Wall -Werror #-}
module Main (main) where
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as S8
main :: IO ()
main = (S8.concat (map S.singleton (S.unpack (S8.pack "<foo>"))) ==
S8.empty) `seq` return ()
}}}
{{{
$ ghc --make -O1 -package={base,bytestring} BodySpec.hs -o a && ./a
Segmentation fault (core dumped)
}}}
The cause is similar to #12757: low-level optimisations inline string
literal (or it's wrapping value? i don't know) in multiple places. That
breaks pointer-chasing in bytestring package.
{{{
$ strings a | fgrep '<foo>'
<foo>
<foo>
<foo>
<foo>
}}}
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12855#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list