From 9832b556cc8ea22508926f67c628f12eea3bd38b Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Fri, 2 Feb 2007 15:12:06 +0000 Subject: [PATCH] Reset the demand info on bindings going to top level (since they cannot be strict) --- compiler/simplCore/SetLevels.lhs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/simplCore/SetLevels.lhs b/compiler/simplCore/SetLevels.lhs index 5dbaec6..6dfb5f1 100644 --- a/compiler/simplCore/SetLevels.lhs +++ b/compiler/simplCore/SetLevels.lhs @@ -842,9 +842,11 @@ cloneRecVars NotTopLevel env@(_,_,subst,_) vs ctxt_lvl dest_lvl returnUs (env', vs2) -- VERY IMPORTANT: we must zap the demand info - -- if the thing is going to float out past a lambda + -- if the thing is going to float out past a lambda, + -- or if it's going to top level (where things can't be strict) zap_demand dest_lvl ctxt_lvl id - | ctxt_lvl == dest_lvl = id -- Stays put - | otherwise = zapDemandIdInfo id -- Floats out + | ctxt_lvl == dest_lvl, + not (isTopLvl dest_lvl) = id -- Stays, and not going to top level + | otherwise = zapDemandIdInfo id -- Floats out \end{code} -- 1.7.10.4