#5920: stack overflow in strict function depending on return type
---------------------------------+------------------------------------------
    Reporter:  ben0x539          |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:  7.6.1           
   Component:  Compiler          |     Version:  7.4.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  Runtime crash   
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by pcapriotti):

 Here's my understanding of what is going on here:

 * pattern-matching causes a join point to be generated
 * a dummy RealWorld argument is added to the join point (see #3403)
 * during w/w construction, the RealWorld argument is removed from the
 worker, effectively undoing the previous step
 * the resulting nested function doesn't have any value arguments, so it's
 not CPR-transformed
 * the final function is CPR'd, but its nested helper (the join point) is
 not, resulting in non-tail recursive code.

 A possible solution is to prevent removing absent RealWorld arguments from
 workers (see attached patch). It doesn't seem necessary to remove them at
 that stage, anyway, since they shouldn't have any impact on the generated
 code.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5920#comment:2>
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

Reply via email to