[commit: ghc] new-demand-to-merge: Make sure we use the zapped-occ-info case-binder when processing the scrutinee (d4a9a39)

Simon Peyton Jones simonpj at microsoft.com
Wed Jan 16 14:38:42 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : new-demand-to-merge

http://hackage.haskell.org/trac/ghc/changeset/d4a9a399142842409fb1ff9a674abaf876ada056

>---------------------------------------------------------------

commit d4a9a399142842409fb1ff9a674abaf876ada056
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jan 16 13:29:40 2013 +0000

    Make sure we use the zapped-occ-info case-binder when processing the scrutinee
    
    A bug-fix to
        7b64905a38ffed5e2d57d9c2f68f6be286a80f93
        Make CSE work for case expressions too

>---------------------------------------------------------------

 compiler/simplCore/CSE.lhs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/simplCore/CSE.lhs b/compiler/simplCore/CSE.lhs
index 55976a2..8bd1586 100644
--- a/compiler/simplCore/CSE.lhs
+++ b/compiler/simplCore/CSE.lhs
@@ -242,12 +242,12 @@ cseExpr env (Case scrut bndr ty alts) = Case scrut' bndr'' ty alts'
 				   where
                                      alts' = cseAlts env2 scrut' bndr bndr'' alts
 				     (env1, bndr') = addBinder env bndr
-                                     (env2, scrut') = cseRhs env1 (bndr', scrut)
-                                        -- Note [CSE for case expressions]
 				     bndr'' = zapIdOccInfo bndr'
 					-- The swizzling from Note [Case binders 2] may
 					-- cause a dead case binder to be alive, so we
 					-- play safe here and bring them all to life
+                                     (env2, scrut') = cseRhs env1 (bndr'', scrut)
+                                        -- Note [CSE for case expressions]
 
 cseAlts :: CSEnv -> OutExpr -> InBndr -> InBndr -> [InAlt] -> [OutAlt]
 





More information about the ghc-commits mailing list