diff options
author | Peter Trommler <ptrommler@acm.org> | 2022-01-28 19:46:33 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-02 23:50:34 -0500 |
commit | d1ef62889f0988317ce0eb495130021f27765689 (patch) | |
tree | e0904ef30a3ef06c85588a56caf6992c89820482 | |
parent | 0a82ae0d9c834661514f11fdf1183ef1b01c50ee (diff) | |
download | haskell-d1ef62889f0988317ce0eb495130021f27765689.tar.gz |
Cmm: fix equality of expressions
Compare expressions and types when comparing `CmmLoad`s.
Fixes #21016
-rw-r--r-- | compiler/GHC/Cmm/CommonBlockElim.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Cmm/CommonBlockElim.hs b/compiler/GHC/Cmm/CommonBlockElim.hs index 9ed08a2d12..5ffab0451c 100644 --- a/compiler/GHC/Cmm/CommonBlockElim.hs +++ b/compiler/GHC/Cmm/CommonBlockElim.hs @@ -222,7 +222,7 @@ eqExprWith :: (BlockId -> BlockId -> Bool) eqExprWith eqBid = eq where CmmLit l1 `eq` CmmLit l2 = eqLit l1 l2 - CmmLoad e1 _ `eq` CmmLoad e2 _ = e1 `eq` e2 + CmmLoad e1 t1 `eq` CmmLoad e2 t2 = e1 `eq` e2 && t1 `cmmEqType` t2 CmmReg r1 `eq` CmmReg r2 = r1==r2 CmmRegOff r1 i1 `eq` CmmRegOff r2 i2 = r1==r2 && i1==i2 CmmMachOp op1 es1 `eq` CmmMachOp op2 es2 = op1==op2 && es1 `eqs` es2 |