
#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 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 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 pinter-chasing in bytestring package. {{{ $ strings a | fgrep '<foo>' <foo> <foo> <foo> <foo> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12855 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler