Optimization breaks strictness with IO
The following program fails with exception when compiled with -O0, but terminates successfully when compiled with -O.
module Main(main) where
import Control.Concurrent.MVar
f l =undefined `seq` putStrLn "q"
main = do
mv <- newMVar ()
f () `seq` putStrLn "Hello"
Trac metadata
Trac field | Value |
---|---|
Version | 6.4.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |