Skip to content

Code using seq has wrong strictness when unoptimised (too strict)

The following piece of code gets miscompiled if no optimisation is used. The program crashes instead of printing [0], which would be the correct behaviour. GHC 7.3.20111127 has been used for triggering this bug.

test = seq (seq id (\a -> undefined a))

main = do
  print $ test [0]
Trac metadata
Trac field Value
Version 7.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC michal.palka@poczta.fm
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information