diff options
Diffstat (limited to 'RegAlloc.hs')
-rw-r--r-- | RegAlloc.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/RegAlloc.hs b/RegAlloc.hs index d2b1717..3a41aac 100644 --- a/RegAlloc.hs +++ b/RegAlloc.hs @@ -42,8 +42,7 @@ regalloc vars' regs aliaspairs = AllocReg r -> Just r in if length (stActive st) == length regs then spillAtInterval st index - else let -- ([regchoice], fr) = splitAt 1 (stFreeRegs st) - (regchoice, fr) = case find (`elem` wantedregs) (stFreeRegs st) of + else let (regchoice, fr) = case find (`elem` wantedregs) (stFreeRegs st) of Nothing -> (head (stFreeRegs st), tail (stFreeRegs st)) Just wr -> trace ("Pair-allocated " ++ show name ++ " in " ++ show wr) $ (wr, stFreeRegs st \\ [wr]) |