#5587: Code using seq has wrong strictness (too lazy) when optimised ---------------------------------+------------------------------------------ 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 ---------------------------------+------------------------------------------ Following program prints `[1]` instead of crashing when compiled with `-O -fno-full-laziness`. Note that it's neccessary to use the extra definition `hiddenError` instead of calling `error` directly. The problem might be related to #5557, which, however, has already been fixed and optimisation is needed to trigger the current bug.
{{{ hiddenError = error "hidden error" main = do print $ seq (head (map (\a -> \b -> hiddenError) (hiddenError::[] Bool))) id [1] }}} I used GHC 7.3.20111022 for triggering this problem. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5587> 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