projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix nasty infelicity: do not short-cut empty substitution in the simplifier
[ghc-hetmet.git]
/
compiler
/
simplCore
/
SimplEnv.lhs
diff --git
a/compiler/simplCore/SimplEnv.lhs
b/compiler/simplCore/SimplEnv.lhs
index
3cdbb32
..
70e0fa1
100644
(file)
--- a/
compiler/simplCore/SimplEnv.lhs
+++ b/
compiler/simplCore/SimplEnv.lhs
@@
-284,10
+284,6
@@
setSubstEnv env tvs ids = env { seTvSubst = tvs, seIdSubst = ids }
mkContEx :: SimplEnv -> InExpr -> SimplSR
mkContEx (SimplEnv { seTvSubst = tvs, seIdSubst = ids }) e = ContEx tvs ids e
mkContEx :: SimplEnv -> InExpr -> SimplSR
mkContEx (SimplEnv { seTvSubst = tvs, seIdSubst = ids }) e = ContEx tvs ids e
-
-isEmptySimplSubst :: SimplEnv -> Bool
-isEmptySimplSubst (SimplEnv { seTvSubst = tvs, seIdSubst = ids })
- = isEmptyVarEnv tvs && isEmptyVarEnv ids
\end{code}
\end{code}
@@
-713,8
+709,8
@@
mkCoreSubst (SimplEnv { seInScope = in_scope, seTvSubst = tv_env, seIdSubst = id
fiddle (ContEx tv id e) = CoreSubst.substExpr (mk_subst tv id) e
substExpr :: SimplEnv -> CoreExpr -> CoreExpr
fiddle (ContEx tv id e) = CoreSubst.substExpr (mk_subst tv id) e
substExpr :: SimplEnv -> CoreExpr -> CoreExpr
-substExpr env expr
- | isEmptySimplSubst env = expr
- | otherwise = CoreSubst.substExpr (mkCoreSubst env) expr
+substExpr env expr = CoreSubst.substExpr (mkCoreSubst env) expr
+ -- Do *not* short-cut in the case of an empty substitution
+ -- See CoreSubst: Note [Extending the Subst]
\end{code}
\end{code}