X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FnativeGen%2FRegAllocLinear.hs;h=14d7eba5a4e77792e03016c5880b5abf36ae4075;hp=888ef16c70e3b6248c0bdc4149838d5b8fcc3297;hb=30c122df62ec75f9ed7f392f24c2925675bf1d06;hpb=78658a70f78b6725055eabafab8a058e835f6d15 diff --git a/compiler/nativeGen/RegAllocLinear.hs b/compiler/nativeGen/RegAllocLinear.hs index 888ef16..14d7eba 100644 --- a/compiler/nativeGen/RegAllocLinear.hs +++ b/compiler/nativeGen/RegAllocLinear.hs @@ -101,6 +101,7 @@ import UniqFM import UniqSupply import Outputable import State +import FastString import Data.Maybe import Data.List @@ -222,7 +223,8 @@ emptyStackMap = StackMap [0..maxSpillSlots] emptyUFM getStackSlotFor :: StackMap -> Unique -> (StackMap,Int) getStackSlotFor (StackMap [] _) _ - = panic "RegAllocLinear.getStackSlotFor: out of stack slots" + = panic "RegAllocLinear.getStackSlotFor: out of stack slots, try -fregs-graph" + -- This happens with darcs' SHA1.hs, see #1993 getStackSlotFor fs@(StackMap (freeSlot:stack') reserved) reg = case lookupUFM reserved reg of @@ -1107,12 +1109,9 @@ pprStats code statss -- ----------------------------------------------------------------------------- -- Utils -#ifdef DEBUG -my_fromJust s p Nothing = pprPanic ("fromJust: " ++ s) p +my_fromJust :: String -> SDoc -> Maybe a -> a my_fromJust _ _ (Just x) = x -#else -my_fromJust _ _ = fromJust -#endif +my_fromJust s p Nothing = pprPanic ("fromJust: " ++ s) p lookItUp :: Uniquable b => String -> UniqFM a -> b -> a lookItUp str fm x = my_fromJust str (ppr (getUnique x)) (lookupUFM fm x)