[GHC] #12656: ghc floats out constant despite -fno-cse

GHC ghc-devs at haskell.org
Tue Oct 4 15:35:45 UTC 2016


#12656: ghc floats out constant despite -fno-cse
-------------------------------------+-------------------------------------
        Reporter:  nh2               |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             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:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 >  What's more mysterious is why you get the "expected" behavior from
 compiled code.

 That could be the effect of the state hack, turning

     foo n = (>>=) (V.unsafeThaw $ V.generate n id) (...)

 into

     foo n rw# = (>>=) (V.unsafeThaw $ V.generate n id) (...) rw#

 and hence making `foo 1000` a PAP where nothing is shared yet. (Did not
 look at the Core, though.)

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


More information about the ghc-tickets mailing list