[GHC] #7411: Exceptions are optimized away in certain situations

GHC ghc-devs at haskell.org
Tue Dec 15 15:11:43 UTC 2015


#7411: Exceptions are optimized away in certain situations
-------------------------------------+-------------------------------------
        Reporter:  SimonHengel       |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.6.1
      Resolution:                    |             Keywords:  seq, deepseq,
                                     |  evaluate, exceptions
Operating System:  Linux             |         Architecture:  x86_64
                                     |  (amd64)
 Type of failure:  Incorrect result  |            Test Case:
  at runtime                         |  simplCore/should_fail/T7411
      Blocked By:                    |             Blocking:
 Related Tickets:  #5129             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by bgamari:

Old description:

> The issue came up in [http://www.haskell.org/pipermail/glasgow-haskell-
> users/2012-November/023027.html this thread on glasgow-haskell-users].
>
> == Steps to reproduce: ==
>
> {{{
> -- file Foo.hs
> import Control.Exception
> import Control.DeepSeq
> main = evaluate (('a' : undefined) `deepseq` return () :: IO ())
> }}}
> {{{
> $ ghc -fforce-recomp -fpedantic-bottoms -O Foo.hs
> }}}
>
> === Expected result: ===
> The program should fail with:
> {{{
> Foo: Prelude.undefined
> }}}
>
> === Actual result: ===
>
> The program succeeds.
>
> Compiling the program with {{{-fno-state-hack}}} helps.

New description:

 The issue came up in [http://www.haskell.org/pipermail/glasgow-haskell-
 users/2012-November/023027.html this thread on glasgow-haskell-users].

 == Steps to reproduce: ==

 {{{#!hs
 -- file Foo.hs
 import Control.Exception
 import Control.DeepSeq
 main = evaluate (('a' : undefined) `deepseq` return () :: IO ())
 }}}
 {{{
 $ ghc -fforce-recomp -fpedantic-bottoms -O Foo.hs
 }}}

 === Expected result: ===
 The program should fail with:
 {{{
 Foo: Prelude.undefined
 }}}

 === Actual result: ===

 The program succeeds.

 Compiling the program with {{{-fno-state-hack}}} helps.

--

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


More information about the ghc-tickets mailing list