Skip to content

-O2 makes exception disappear

In this example, an exception throw/catch seems not to happen when optimization is turned on. The behavior seems to be quite finicky. Collapsing the code into fewer than the three given modules seems either to make the bug go away or to produce a "internal error: PAP object entered!" message. Other seemingly innocuous changes produce similar results.

On both Linux and MacOS, this program produces "False" with no optimization flags to ghc, or "True" with -O2.

On 6.10.4 on Linux, it produces "False" with or without -O2.

Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information