From 6934a650f1d58e5621699991f2cbea44e2f2e6e7 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 1 Mar 2001 14:27:22 +0000 Subject: [PATCH] [project @ 2001-03-01 14:27:22 by simonmar] don't needlessly duplicate a binder. --- ghc/compiler/stgSyn/CoreToStg.lhs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 -- 1.7.10.4