From 5f1154e0e3339dd1cabf7a7129337d8aa191fca7 Mon Sep 17 00:00:00 2001
From: Sven Tennie <sven.tennie@wire.com>
Date: Fri, 30 Jun 2023 08:00:16 +0000
Subject: [PATCH] x86 CodeGen: MO_S_MulMayOflo better error message for rep >
 W64

It's useful to see which value made the pattern match fail. (If it ever
occurs.)
---
 compiler/GHC/CmmToAsm/X86/CodeGen.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/GHC/CmmToAsm/X86/CodeGen.hs b/compiler/GHC/CmmToAsm/X86/CodeGen.hs
index c5d31a718b79..1bc72c3679bc 100644
--- a/compiler/GHC/CmmToAsm/X86/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/X86/CodeGen.hs
@@ -976,7 +976,7 @@ getRegister' _ is32Bit (CmmMachOp mop [x, y]) = -- dyadic MachOps
                            W16 -> 15
                            W32 -> 31
                            W64 -> 63
-                           _ -> panic "shift_amt"
+                           w -> panic ("shift_amt: " ++ show w)
 
              format = intFormat rep
              code = a_code `appOL` b_code eax `appOL`
-- 
GitLab