
#16197: Strictness is not preserved under -O1 -------------------------------------+------------------------------------- Reporter: alang9 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- With -O0, the attached code prints: {{{
/usr/local/ghc/ghc-8.4.1.0/bin/ghc -O0 src/foo.hs; and ./src/foo [1 of 1] Compiling Main ( src/foo.hs, src/foo.o ) [Optimisation flags changed] Linking src/foo ... ("exec",0) ("depth",0) ("exec",1) ("depth",0) }}}
But with -O1, it prints: {{{
/usr/local/ghc/ghc-8.4.1.0/bin/ghc -O1 src/foo.hs; and ./src/foo [1 of 1] Compiling Main ( src/foo.hs, src/foo.o ) Linking src/foo ... ("depth",0) ("depth",0) }}}
Reproduced with 8.4.1 and 8.6.2. Doesn't seem to happen under 8.2.0 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16197 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler