[Git][ghc/ghc][master] compiler: fix lowering of CmmBlock in the wasm NCG

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Jan 28 08:02:08 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
6ea2aa02 by Cheng Shao at 2023-01-28T03:01:46-05:00
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.

- - - - -


1 changed file:

- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs


Changes:

=====================================
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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ea2aa0293aedea2f873b7b5d9cff5e7b9e2f188

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ea2aa0293aedea2f873b7b5d9cff5e7b9e2f188
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230128/517b87a3/attachment.html>


More information about the ghc-commits mailing list