"panic: Labels in code should be printed with pprCLabel"
I tried to compile this module:
{-# LANGUAGE UnboxedSums, MagicHash, UnboxedSums #-}
module M where
import GHC.Exts
import GHC.Word
bar :: (# Word8# | Word64# #) -> Word8#
bar (# x | #) = plusWord8# x (case 1 of W8# x -> x)
bar (# | _ #) = (case 1 of W8# x -> x)
with
~/ghc_head/_perf/stage1/bin/ghc Test.hs -O -dstg-lint -fforce-recomp -ddump-cmm -ddump-to-file -dno-typeable-binds -v -ddump-stg-final -fprint-explicit-kinds -ddump-stg-from-core -dcmm-lint
Without any changes to GHC itself by me.
I assume this has been broken by !8902 (closed)
It seems pretty extreme to have a OutputableP
instance which just panics. Especially given how often these end up used during development to add a trace somewhere.
It seems more appropriate to rather just emit the label + maybe a warning in such a case.