Miscompilation, exception omitted with -O
|Reported by:||michal.palka||Owned by:||simonpj|
|Keywords:||strictness strict exception miscompilation||Cc:||michal.palka@…|
|Type of failure:||Incorrect result at runtime||Test Case:||codeGen/should_run/5626|
|Related Tickets:||Differential Rev(s):|
Following program is miscompiled when compiled with -O.
module Main where wrap x = [x]!!0 f :: [Int] -> a f a = foldr (\b -> \c -> c) (undefined ()) (a ++ a) 0 main = do print $ (f  :: String) print $ wrap $ (f  :: Int) print $ wrap $ (f  :: (Int, Int, Int, Int))
The result of running it on my machine (Linux x86-64) is following:
" 1099511628032 zsh: segmentation fault ./test7
Looking at the Core it seems that instead of the expected undefined a partially-applied function is returned. GHC 7.3.20111022 was used for testing.
Change History (4)
comment:1 Changed 5 years ago by simonmar
- Milestone set to 7.4.1
- Priority changed from normal to high