summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-03-12 14:09:37 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-17 19:08:27 -0400
commit6b10163e0da90dfc0eeb52549598faa2c0527e37 (patch)
treebd4e165881b813db87c23dbca71ca45b41093b71
parentfe6cad22353ee027358251cbf91a3811c6e925ff (diff)
downloadhaskell-6b10163e0da90dfc0eeb52549598faa2c0527e37.tar.gz
Disable bogus assertion (#19489)
-rw-r--r--compiler/GHC/CoreToStg/Prep.hs17
1 files changed, 15 insertions, 2 deletions
diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs
index 3eb714405c..5395a737d6 100644
--- a/compiler/GHC/CoreToStg/Prep.hs
+++ b/compiler/GHC/CoreToStg/Prep.hs
@@ -1407,8 +1407,21 @@ mkFloat dmd is_unlifted bndr rhs
-- Don't make a case for a HNF binding, even if it's strict
-- Otherwise we get case (\x -> e) of ...!
- | is_unlifted = ASSERT2( ok_for_spec, ppr rhs )
- FloatCase rhs bndr DEFAULT [] True
+ | is_unlifted = FloatCase rhs bndr DEFAULT [] True
+ -- we used to ASSERT2(ok_for_spec, ppr rhs) here, but it is now disabled
+ -- because exprOkForSpeculation isn't stable under ANF-ing. See for
+ -- example #19489 where the following unlifted expression:
+ --
+ -- GHC.Prim.(#|_#) @LiftedRep @LiftedRep @[a_ax0] @[a_ax0]
+ -- (GHC.Types.: @a_ax0 a2_agq a3_agl)
+ --
+ -- is ok-for-spec but is ANF-ised into:
+ --
+ -- let sat = GHC.Types.: @a_ax0 a2_agq a3_agl
+ -- in GHC.Prim.(#|_#) @LiftedRep @LiftedRep @[a_ax0] @[a_ax0] sat
+ --
+ -- which isn't ok-for-spec because of the let-expression.
+
| is_hnf = FloatLet (NonRec bndr rhs)
| otherwise = FloatLet (NonRec (setIdDemandInfo bndr dmd) rhs)
-- See Note [Pin demand info on floats]