summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/basicTypes/IdInfo.hs5
-rw-r--r--compiler/simplCore/Simplify.hs7
2 files changed, 10 insertions, 2 deletions
diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs
index f29fba7db1..bd6ec8f293 100644
--- a/compiler/basicTypes/IdInfo.hs
+++ b/compiler/basicTypes/IdInfo.hs
@@ -29,7 +29,7 @@ module IdInfo (
-- ** Zapping various forms of Info
zapLamInfo, zapFragileInfo,
zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo,
- zapTailCallInfo,
+ zapTailCallInfo, zapCallArityInfo,
-- ** The ArityInfo type
ArityInfo,
@@ -553,6 +553,9 @@ zapTailCallInfo info
where
safe_occ = occ { occ_tail = NoTailCallInfo }
+zapCallArityInfo :: IdInfo -> IdInfo
+zapCallArityInfo info = setCallArityInfo info 0
+
{-
************************************************************************
* *
diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs
index 1b89f3e394..43006f87d3 100644
--- a/compiler/simplCore/Simplify.hs
+++ b/compiler/simplCore/Simplify.hs
@@ -803,7 +803,12 @@ completeBind env top_lvl is_rec mb_cont old_bndr new_bndr new_rhs
| otherwise
= info2
- final_id = new_bndr `setIdInfo` info3
+ -- Zap call arity info. We have used it by now (via
+ -- `tryEtaExpandRhs`), and the simplifier can invalidate this
+ -- information, leading to broken code later (e.g. #13479)
+ info4 = zapCallArityInfo info3
+
+ final_id = new_bndr `setIdInfo` info4
; -- pprTrace "Binding" (ppr final_id <+> ppr new_unfolding) $
return (addNonRec env final_id final_rhs) } }