[GHC] #14868: -O -g breaks string literals
#14868: -O -g breaks string literals -------------------------------------+------------------------------------- Reporter: akio | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- With `foo.hs`: {{{#!hs main = print (4, "foo") }}} Compile it and run it like: {{{ % ghc-stage2 -O -g foo.hs % ./foo (4,"\CANq@") }}} Note that the content of the string literal is broken, although the length is preserved. With `-dcore-lint`, the following error is produced: {{{ *** Core Lint errors : in result of Simplifier *** <no location info>: warning: [RHS of ww2_s3hG :: Addr#] Recursive or top-level binder has strict demand info: ww2_s3hG Binder's demand info: <L,U> }}} The offending binding is: {{{#!hs ww2_s3hG :: Addr# [LclId, Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] ww2_s3hG = src<foo.hs:1:18-22> "foo"# }}} Happens with ghc 8.4.1-rc1 and with HEAD (df2c3b33648). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14868> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14868: -O -g breaks string literals -------------------------------------+------------------------------------- Reporter: akio | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #14779, #14123 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => duplicate * related: => #14779, #14123 Comment: Indeed Bartosz is looking at this and related issues in #14779. Also see #14123. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14868#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14868: -O -g breaks string literals -------------------------------------+------------------------------------- Reporter: akio | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #14779, #14123 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by niteria): Nice test case, I added it to https://phabricator.haskell.org/D4470. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14868#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14868: -O -g breaks string literals -------------------------------------+------------------------------------- Reporter: akio | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #14779, #14123 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): bgamari, is this supposed to be fixed in GHC 8.4.1? I can reproduce this error: {{{ $ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.4.1 $ cat Main.hs {-# OPTIONS -O -g #-} main = print (4, "foo") $ ghc Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... $ ./Main (4,"\248m@") }}} I tried with both DWARF and non-DWARF build. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14868#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14868: -O -g breaks string literals -------------------------------------+------------------------------------- Reporter: akio | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.2 Component: Compiler | Version: 8.5 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #14779, #14123 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.4.2 Comment: Unfortunately due to a mistake in the bindist preparation this patch didn't quite make it for 8.4.1. It will be present in 8.4.2 (which will likely happen soon). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14868#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC