#5625: Code using seq has wrong strictness when unoptimised (too lazy)
---------------------------------+------------------------------------------
    Reporter:  michal.palka      |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  Compiler                   
     Version:  7.3               |    Keywords:  seq strictness strict lazy 
    Testcase:                    |   Blockedby:                             
          Os:  Unknown/Multiple  |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------
 The code code should crash with Prelude.undefined. When compiled with `-O`
 it behaves correctly, however with no optimisation (`-O0`) it prints `[0]`
 instead. Reading the Core suggests that the expression gets translated
 into `print (id [0])` when compiled with `-O0`. It was tested with GHC
 7.3.20111022.

 {{{
 main = do
   let a = \x -> seq undefined (+1)
   print $ (a `seq` a [] `seq` id) [0]
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5625>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to