summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/specialise/Rules.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index 7cf6e56bb7..f1288ccc64 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -483,7 +483,7 @@ matchRule :: DynFlags -> InScopeEnv -> (Activation -> Bool)
-- then (f args) matches the rule, and the corresponding
-- rewritten RHS is rhs
--
--- The bndrs and rhs is occurrence-analysed
+-- The returned expression is occurrence-analysed
--
-- Example
--
@@ -505,8 +505,9 @@ matchRule dflags rule_env _is_active fn args _rough_args
(BuiltinRule { ru_try = match_fn })
-- Built-in rules can't be switched off, it seems
= case match_fn dflags rule_env fn args of
- Just expr -> Just expr
Nothing -> Nothing
+ Just expr -> Just (occurAnalyseExpr expr)
+ -- We could do this when putting things into the rulebase, I guess
matchRule _ in_scope is_active _ args rough_args
(Rule { ru_act = act, ru_rough = tpl_tops