
#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: