[GHC] #15832: returnIO/bindIO destroys runtime explicit stack information in some cases

GHC ghc-devs at haskell.org
Fri Nov 2 02:35:47 UTC 2018


#15832: returnIO/bindIO destroys runtime explicit stack information in some cases
-------------------------------------+-------------------------------------
        Reporter:  infinity0         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 If you look at the STG you will see that in the good case we get STG of
 the form,
 {{{#!hs
 main = (>>) (return undefined) (print (X (error ...)))
 }}}
 The second argument then becomes a CAF during codegen. This CAF then as a
 cost-center added to it due to `-fprof-cafs`.

 The bad case, on the other hand, is of the form:
 {{{#!hs
 main = (>>=) (return undefined) (\_ -> print (X (error ...)))
 }}}
 Here the second argument is not a CAF and therefore will not get a cost-
 center.

 This is the reason for this difference.

 Out of curiosity, what is your application?

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


More information about the ghc-tickets mailing list