summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2022-09-27 00:10:47 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-30 14:50:58 -0500
commit31462d98c31e3ef48af2f6c6f2d379d74ccc63f5 (patch)
treee9b4748c3bf96a6e96057ce7cffb12d5e1448bb9 /compiler/GHC/Cmm
parenta9d9b8c0458e838f331ead62dca272665ecbf20d (diff)
downloadhaskell-31462d98c31e3ef48af2f6c6f2d379d74ccc63f5.tar.gz
Properly cast values when writing/reading unboxed sums.
Unboxed sums might store a Int8# value as Int64#. This patch makes sure we keep track of the actual value type. See Note [Casting slot arguments] for the details.
Diffstat (limited to 'compiler/GHC/Cmm')
-rw-r--r--compiler/GHC/Cmm/CLabel.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs
index 96f78b6789..c492e8e7c1 100644
--- a/compiler/GHC/Cmm/CLabel.hs
+++ b/compiler/GHC/Cmm/CLabel.hs
@@ -1448,7 +1448,8 @@ instance OutputableP Platform CLabel where
pdoc !platform lbl = getPprStyle $ \pp_sty ->
case pp_sty of
PprDump{} -> pprCLabel platform lbl
- _ -> pprPanic "Labels in code should be printed with pprCLabel or pprAsmLabel" (pprCLabel platform lbl)
+ _ -> let lbl_doc = (pprCLabel platform lbl)
+ in pprTraceUserWarning (text "Labels in code should be printed with pprCLabel or pprAsmLabel" <> lbl_doc) lbl_doc
pprCLabelStyle :: forall doc. IsLine doc => Platform -> LabelStyle -> CLabel -> doc
pprCLabelStyle !platform !sty lbl = -- see Note [Bangs in CLabel]