From d88a1d8cd8ef52a1c6799b83b8d7c9753adfdd40 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 6 Dec 2001 09:21:32 +0000 Subject: [PATCH] [project @ 2001-12-06 09:21:31 by simonpj] Fix the simplIdInfo inconsistency Sigbjorn found --- ghc/compiler/coreSyn/Subst.lhs | 8 ++++---- ghc/compiler/simplCore/Simplify.lhs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/coreSyn/Subst.lhs b/ghc/compiler/coreSyn/Subst.lhs index 07e3b0f..745f0a1 100644 --- a/ghc/compiler/coreSyn/Subst.lhs +++ b/ghc/compiler/coreSyn/Subst.lhs @@ -610,13 +610,13 @@ simplLetId subst@(Subst in_scope env) old_id | otherwise = delSubstEnv env old_id -simplIdInfo :: Subst -> IdInfo -> Id -> Id +simplIdInfo :: Subst -> IdInfo -> IdInfo -- Used by the simplifier to compute new IdInfo for a let(rec) binder, -- subsequent to simplLetId having zapped its IdInfo -simplIdInfo subst old_info bndr +simplIdInfo subst old_info = case substIdInfo subst isFragileOcc old_info of - Just new_info -> bndr `setIdInfo` new_info - Nothing -> bndr `setIdInfo` old_info + Just new_info -> new_info + Nothing -> old_info \end{code} \begin{code} diff --git a/ghc/compiler/simplCore/Simplify.lhs b/ghc/compiler/simplCore/Simplify.lhs index b912cff..af9ac73 100644 --- a/ghc/compiler/simplCore/Simplify.lhs +++ b/ghc/compiler/simplCore/Simplify.lhs @@ -299,7 +299,7 @@ simplNonRecBind env bndr rhs rhs_se cont_ty thing_inside let -- simplLetBndr doesn't deal with the IdInfo, so we must -- do so here (c.f. simplLazyBind) - bndr'' = simplIdInfo (getSubst env) (idInfo bndr) bndr' + bndr'' = bndr' `setIdInfo` simplIdInfo (getSubst env) (idInfo bndr) env1 = modifyInScope env bndr'' bndr'' in simplStrictArg AnRhs env1 rhs rhs_se (idType bndr') cont_ty $ \ env rhs1 -> @@ -447,7 +447,7 @@ simplLazyBind env top_lvl is_rec bndr bndr' rhs rhs_se -- -- NB: does no harm for non-recursive bindings let - bndr'' = simplIdInfo (getSubst rhs_se) (idInfo bndr) bndr' + bndr'' = bndr' `setIdInfo` simplIdInfo (getSubst env) (idInfo bndr) env1 = modifyInScope env bndr'' bndr'' rhs_env = setInScope rhs_se env1 is_top_level = isTopLevel top_lvl -- 1.7.10.4