summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen.Lippmeier@anu.edu.au <unknown>2009-01-10 02:58:02 +0000
committerBen.Lippmeier@anu.edu.au <unknown>2009-01-10 02:58:02 +0000
commit8c4b04006dcf5aedfb11fcbc7fcfb05c2b387f92 (patch)
tree1b709a522df75fffc005f58ffccb24c20e4e2f5d
parent598d761c769316dc4550028285f6508538b8a99c (diff)
downloadhaskell-8c4b04006dcf5aedfb11fcbc7fcfb05c2b387f92.tar.gz
Better panic message in RegAllocLinear
-rw-r--r--compiler/nativeGen/RegAllocLinear.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/nativeGen/RegAllocLinear.hs b/compiler/nativeGen/RegAllocLinear.hs
index c67ce3ee6a..c4a5a4a632 100644
--- a/compiler/nativeGen/RegAllocLinear.hs
+++ b/compiler/nativeGen/RegAllocLinear.hs
@@ -699,8 +699,11 @@ allocateRegsAndSpill reading keep spills alloc (r:rs) = do
-- to spill. We just pick the first one that isn't used in
-- the current instruction for now.
- let (temp_to_push_out, my_reg) = myHead "regalloc" candidates2
-
+ let (temp_to_push_out, my_reg)
+ = case candidates2 of
+ [] -> panic "RegAllocLinear.allocRegsAndSpill: no spill candidates"
+ (x:_) -> x
+
(spill_insn, slot) <- spillR (RealReg my_reg) temp_to_push_out
let spill_store = (if reading then id else reverse)
[ COMMENT (fsLit "spill alloc")
@@ -741,9 +744,6 @@ loadTemp _ _ _ _ spills =
return spills
-myHead s [] = panic s
-myHead _ (x:_) = x
-
-- -----------------------------------------------------------------------------
-- Joining a jump instruction to its targets