joinToTargets: fix a case of panic "handleComponent cyclic"
authorSimon Marlow <marlowsd@gmail.com>
Fri, 18 Jun 2010 08:21:47 +0000 (08:21 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 18 Jun 2010 08:21:47 +0000 (08:21 +0000)
compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs

index 8ff06eb..a9367f9 100644 (file)
@@ -289,7 +289,8 @@ handleComponent delta _  (AcyclicSCC (vreg, src, dsts))
 --     require a fixup.
 --
 handleComponent delta instr 
-       (CyclicSCC      ( (vreg, InReg sreg, [InReg dreg]) : rest))
+       (CyclicSCC      ( (vreg, InReg sreg, (InReg dreg: _)) : rest))
+        -- dest list may have more than one element, if the reg is also InMem.
  = do
        -- spill the source into its slot
        (instrSpill, slot)