Ah excellent point!  Thank you for providing a nice example.  I believe I have 
fixed the bug.  Can you try again with LibCase enabled?

Thanks

Simon

| -----Original Message-----
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Gill
| Sent: 20 June 2007 07:53
| To: [email protected]
| Subject: patch applied (ghc): Turning off case liberation when using the hpc 
option, for now
|
| Tue Jun 19 23:49:43 PDT 2007  [EMAIL PROTECTED]
|   * Turning off case liberation when using the hpc option, for now
|
|   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 happen sometimes in HPC, because every tick is a liberate-able case,
|   but is a general problem to case liberation (I think).
|
|
|     M ./compiler/main/DynFlags.hs -1 +2
|
| _______________________________________________
| Cvs-ghc mailing list
| [email protected]
| http://www.haskell.org/mailman/listinfo/cvs-ghc

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to