[GHC] #12757: Compiled program segfaults at -O1

GHC ghc-devs at haskell.org
Tue Oct 25 15:53:04 UTC 2016


#12757: Compiled program segfaults at -O1
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.0.2
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime crash     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11312, #12585    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Ah!  Good insight.  comment:3 of #11312 would nail this problem, and we
 should do that anyway.

 Short term, not duplicating literal strings seems like the way forward.

 They are duplicated in `CorePrep`, apparently because of

 * Edwards's patch for #12076 made `CorePrep` a bit more gung ho about
 inlining

 * When inlining in `CorePrep` we use `cpe_ExprIsTrivial`, which treats all
 literals (including strings) as trivial and hence inlinable.  No one quite
 knows why: see #11158

 So the best path forward seems to be to fix #11158, which we want to do
 anyway. Then we won't duplicate string literals, and `bytestring` will
 probably be happy again.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12757#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list