[GHC] #11555: catch _|_ breaks at -O1

GHC ghc-devs at haskell.org
Wed Mar 2 00:09:29 UTC 2016


#11555: catch _|_ breaks at -O1
-------------------------------------+-------------------------------------
        Reporter:  slyfox            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  8.0.1-rc2
      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 simonpj):

 Very helpful!  I know what is happening.

 Everything works fine until `CorePrep`. At that point we have
 {{{
 catch# (lazy (f x)) blah
 }}}
 Now `CorePrep`
  * Replaces `lazy e` by `e`
  * Converts to ANF, using `let` or `case` depending on whether the
 function is strict
 Unfortunately, that results in
 {{{
 case f x of r -> catch# r blah
 }}}
 which is wrong of course.  We need that `lazy` to defeat the call-by-value
 transformation too.

 So our fix is right; this is really a bug in the implementation of `lazy`.

 I don't have a fix for this yet, but we have some progress.

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


More information about the ghc-tickets mailing list