From: simonmar Date: Thu, 1 Mar 2001 14:27:22 +0000 (+0000) Subject: [project @ 2001-03-01 14:27:22 by simonmar] X-Git-Tag: Approximately_9120_patches~2505 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6934a650f1d58e5621699991f2cbea44e2f2e6e7;p=ghc-hetmet.git [project @ 2001-03-01 14:27:22 by simonmar] don't needlessly duplicate a binder. --- diff --git a/ghc/compiler/stgSyn/CoreToStg.lhs b/ghc/compiler/stgSyn/CoreToStg.lhs index a5e0e85..b59411d 100644 --- a/ghc/compiler/stgSyn/CoreToStg.lhs +++ b/ghc/compiler/stgSyn/CoreToStg.lhs @@ -295,9 +295,11 @@ coreToStgExpr (Case scrut bndr alts) lookupLiveVarsForSet alts_fvs `thenLne` \ alts_lvs -> let -- determine whether the default binder is dead or not - bndr' = bndr `setIdOccInfo` occ_info - occ_info | bndr `elementOfFVInfo` alts_fvs = NoOccInfo - | otherwise = IAmDead + -- This helps the code generator to avoid generating an assignment + -- for the case binder (is extremely rare cases) ToDo: remove. + bndr'= if (bndr `elementOfFVInfo` alts_fvs) + then bndr + else bndr `setIdOccInfo` IAmDead -- for a _ccall_GC_, some of the *arguments* need to live across the -- call (see findLiveArgs comments.), so we annotate them as being live