Opened 20 months ago

Last modified 5 weeks ago

#7411 new bug

Exceptions are optimized away in certain situations

Reported by: SimonHengel Owned by:
Priority: high Milestone: 7.8.4
Component: Compiler Version: 7.6.1
Keywords: seq, deepseq, evaluate, exceptions Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Incorrect result at runtime Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:


The issue came up in 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.

Change History (2)

comment:1 Changed 15 months ago by igloo

  • Difficulty set to Unknown
  • Milestone set to 7.8.1
  • Priority changed from normal to high

Thanks for the report.

comment:2 Changed 5 weeks ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.8.4

Moving to 7.8.4.

Note: See TracTickets for help on using tickets.