diff options
author | Cheng Shao <terrorjack@type.dance> | 2023-01-27 14:29:38 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-28 03:01:46 -0500 |
commit | 6ea2aa0293aedea2f873b7b5d9cff5e7b9e2f188 (patch) | |
tree | f59ea0db3a118650f90412edb49c032c9f3a4a45 | |
parent | 7e11c6dc25cb9dd14ae33ee9715ddbc8ebf9836e (diff) | |
download | haskell-6ea2aa0293aedea2f873b7b5d9cff5e7b9e2f188.tar.gz |
compiler: fix lowering of CmmBlock in the wasm NCG
The CmmBlock datacon was not handled in lower_CmmLit, since I thought
it would have been eliminated after proc-point splitting. Turns out it
still occurs in very rare occasions, and this patch is needed to fix
T9329 for wasm.
-rw-r--r-- | compiler/GHC/CmmToAsm/Wasm/FromCmm.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs b/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs index 2a2fafda4a..c07399836a 100644 --- a/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs +++ b/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs @@ -31,6 +31,7 @@ import Data.String import Data.Traversable import Data.Type.Equality import GHC.Cmm +import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Label @@ -861,6 +862,7 @@ lower_CmmLit lit = do WasmSymConst sym `WasmConcat` WasmConst ty_word (toInteger o) `WasmConcat` WasmAdd ty_word + CmmBlock bid -> lower_CmmLit $ CmmLabel $ infoTblLbl bid _ -> panic "lower_CmmLit: unreachable" -- | Lower a 'CmmReg'. Some of the logic here wouldn't be needed if |