#917: -O introduces space leak
----------------------------------------+-----------------------------------
    Reporter:  claus.reinke@…           |        Owner:              
        Type:  bug                      |       Status:  new         
    Priority:  lowest                   |    Milestone:  _|_         
   Component:  Compiler                 |      Version:  6.5         
    Keywords:                           |     Testcase:              
   Blockedby:                           |   Difficulty:  Unknown     
          Os:  Unknown/Multiple         |     Blocking:              
Architecture:  Unknown/Multiple         |      Failure:  None/Unknown
----------------------------------------+-----------------------------------

Comment(by batterseapower):

 An interesting example of this occurs with something like:

 {{{
 foo act = forM_ [1..10000] act
 }}}

 Currently full-laziness floats the list out of foo. Not only does this
 increase space usage, it also disables the fusion that would ordinarily
 occur between the list and forM_.

 I guess the reason this is that the rules matcher sees that applying the
 foldr/build rule for that shared build might destroy sharing. However,
 maybe the rules matcher should be allowed to duplicate work as long as it
 was duplicated in the original source program?

 So when we float out, we say "OK, we're going to share this work for now,
 but if we spot a RULE opportunity at a later stage we're going to undo
 this sharing.". This would at least fix this case, but it does not seem at
 all straightforward how to represent information about this "original"
 lack of sharing.

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