|
stack overflow triggered by profiling in ghc 6: msg#00040lang.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. The slight alteration wrapper_sum xs = I# (ub_acc_sum xs 0#) ub_acc_sum :: [Int] -> Int# -> Int# ub_acc_sum [] v = v ub_acc_sum ((I# x):xs) v = ub_acc_sum xs (v +# x) is fine with all combinations of flags. mrak -- oh, he's like milk to you half swedish and half asian -- Soul Coughing
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | simplCore/Simplify.lhs:1442: Non-exhaustive patterns in function cat_evals, Alastair Reid |
|---|---|
| Next by Date: | -fno-implicit-prelude -prof bug on x86, Ashley Yakeley |
| Previous by Thread: | simplCore/Simplify.lhs:1442: Non-exhaustive patterns in function cat_evals, Alastair Reid |
| Next by Thread: | RE: stack overflow triggered by profiling in ghc 6, Simon Marlow |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |