Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 376
    • Merge Requests 376
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14868

Closed
Open
Opened Feb 28, 2018 by takano-akio@takano-akioReporter

-O -g breaks string literals

With foo.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:

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 (df2c3b33).

Trac metadata
Trac field Value
Version 8.5
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.4.2
Milestone
8.4.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14868