#3677: Optimizer creates stack overflow on filtered CAF
----------------------------+-----------------------------------------------
  Reporter:  jpet           |          Owner:             
      Type:  bug            |         Status:  new        
  Priority:  normal         |      Milestone:  6.12 branch
 Component:  Compiler       |        Version:  6.10.4     
Resolution:                 |       Keywords:             
Difficulty:                 |             Os:  Windows    
  Testcase:                 |   Architecture:  x86        
   Failure:  Runtime crash  |  
----------------------------+-----------------------------------------------
Comment (by simonpj):

 Nice report, thanks.  Here is a totally self-contained example:
 {{{
 module Main(main) where

 main = mapM_ print (edi 0)

 edi :: Integer -> [Integer]
 edi x | x `mod` 10000000 == 0 = x : edi (x+1)
       | otherwise             = edi (x+1)

 edi2 :: Integer -> [Integer]
 edi2 x | x `mod` 10000000 == 0 = x : y
        | otherwise             = y
        where
          y = edi2 (x+1)
 }}}
 Works in a 1k stack with `edi`, but needs 95k for `edi2`.

 Two bugs here:
  * Stack squeezing isn't working right (Simon M will investigate)
  * The optimiser should probably convert one into the other anyway (Simon
 PJ will look)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3677#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to