|
RE: stack overflow triggered by profiling in ghc 6: msg#00051lang.haskell.glasgow.bugs
> Not sure if this counts as a bug or not, but I've got the following > program: > > > import GHC.Exts > import Data.List > > wrapper_sum xs = ub_acc_sum xs 0# > ub_acc_sum :: [Int] -> Int# -> Int > ub_acc_sum [] v = I# v > ub_acc_sum ((I# x):xs) v = ub_acc_sum xs (v +# x) > > main = do > let l = take 10000000 [1,1..] > seq (last l) $ return () > putStrLn "unboxed accum" > putStrLn $ show $ wrapper_sum l > > When compiled with -O2 or -O1, and -prof and -auto-all, this > runs out of > stack space. Without optimisation, it's fine: likewise, > without -prof it's > fine, which seems reasonable: AFAICT, ub_acc_sum is tail-recursive. While this behaviour is undesirable, I'm afraid it is entirely possible. Compiling with profiling can, and very often does, affect the code that gets generated - this is because in order to retain a correct cost model, the optimiser must disable certain transformations. Cheers, Simon
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: GHC 6.0: warning!, Simon Marlow |
|---|---|
| Next by Date: | GHC 6 for Mac OS X: fix for package util/readline, Arthur Baars |
| Previous by Thread: | stack overflow triggered by profiling in ghc 6, Mark Alexander Wotton |
| Next by Thread: | -fno-implicit-prelude -prof bug on x86, Ashley Yakeley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |