Opened 3 years ago

Last modified 8 weeks ago

#7411 new bug

Exceptions are optimized away in certain situations

Reported by: SimonHengel Owned by:
Priority: high Milestone: 8.0.1
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 Test Case: simplCore/should_fail/T7411
Blocked By: Blocking:
Related Tickets: #5129 Differential Rev(s):
Wiki Page:

Description (last modified by bgamari)

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 (9)

comment:1 Changed 3 years 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 20 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.8.4

Moving to 7.8.4.

comment:3 Changed 16 months ago by thoughtpolice

  • Milestone changed from 7.8.4 to 7.10.1

Moving (in bulk) to 7.10.4

comment:4 Changed 13 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.12.1

Moving to 7.12.1

comment:5 Changed 6 months ago by thomie

comment:6 Changed 5 months ago by Ben Gamari <ben@…>

In 15cb83d4/ghc:

Add testcase for #7411

comment:7 Changed 5 months ago by thoughtpolice

  • Milestone changed from 7.12.1 to 8.0.1

Milestone renamed

comment:8 Changed 4 months ago by bgamari

  • Test Case set to simplCore/should_fail/T7411

comment:9 Changed 8 weeks ago by bgamari

  • Description modified (diff)
Note: See TracTickets for help on using tickets.