Wed Jun 20 00:56:48 PDT 2007 [EMAIL PROTECTED]
* Fix egregious sharing bug in LiberateCase
Andy Gill writes: consider the following code
f = g (case v of
V a b -> a : t f)
where g is expensive. Liberate case will turn this into
f = g (case v of
V a b -> a : t (letrec f = g (case v of
V a b -> a : f t)
in f)
)
Yikes! We evaluate g twice. This leads to a O(2^n) explosion
if g calls back to the same code recursively.
This may be the same as Trac #1366.
M ./compiler/simplCore/LiberateCase.lhs -4 +22
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc