[project @ 2004-01-08 11:53:29 by simonpj]
authorsimonpj <unknown>
Thu, 8 Jan 2004 11:53:29 +0000 (11:53 +0000)
committersimonpj <unknown>
Thu, 8 Jan 2004 11:53:29 +0000 (11:53 +0000)
commitd29520cb62a9bc7ff38b1dd83f336f0d6997bf6c
tree75bdd18275f826785e43ae11afbbe630d3b420ac
parentc0c05bb3fbfdd1a82bccdcbc34c77a4927c99316
[project @ 2004-01-08 11:53:29 by simonpj]
---------------------------------------
Fix a long-standing CSE bug with unboxed tuples
  ---------------------------------------

Merge to stable

Consider
        case f x of
  (# a,b #) -> if a>0
       then f x -- CSE opportunity
       else (# b,a #)

 GHC 6.2's CSE pass wrongly optimised this to:

case f x of t
  (# a,b #) -> if a>0 then
  t -- WRONG
else (# b,a #)

(Wrong because we aren't allowed to mention a case binder for
an unboxed-tuple case.)

This commit fixes the problem.
ghc/compiler/simplCore/CSE.lhs