[GHC] #11555: catch under unsafePerformIO breaks on -O1

GHC ghc-devs at haskell.org
Mon Feb 8 13:00:03 UTC 2016


#11555: catch under unsafePerformIO breaks on -O1
-------------------------------------+-------------------------------------
        Reporter:  slyfox            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1-rc2
      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:                    |
-------------------------------------+-------------------------------------
Changes (by NeilMitchell):

 * cc: ndmitchell (added)


Comment:

 I ran into this today in the Shake test suite. My reduced case doesn't
 rely on {{{unsafePerformIO}}}.

 {{{#!hs
 {-# LANGUAGE ScopedTypeVariables #-}
 module Main(main) where
 import Control.Exception
 main :: IO ()
 main = (undefined :: IO ()) `catch` \(e :: SomeException) -> putStrLn
 "Success"
 }}}

 At {{{-O0}}} this program is equivalent to {{{putStrLn "Success"}}}. At
 {{{-O1}}} and above this program is equivalent to {{{undefined}}}.

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


More information about the ghc-tickets mailing list