From: Simon Marlow Date: Fri, 3 Mar 2006 13:31:35 +0000 (+0000) Subject: callerSaveVolatileRegs: fix the Nothing case X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=dcab96f951d193fd577e25c10358501810db8a93 callerSaveVolatileRegs: fix the Nothing case When the volatile regs attached to a CmmCall is Nothing, it means "save everything", not "save nothing". --- diff --git a/ghc/compiler/nativeGen/MachRegs.lhs b/ghc/compiler/nativeGen/MachRegs.lhs index ef3086b..bffb723 100644 --- a/ghc/compiler/nativeGen/MachRegs.lhs +++ b/ghc/compiler/nativeGen/MachRegs.lhs @@ -359,7 +359,12 @@ callerSaveVolatileRegs vols = (caller_save, caller_load) regs_to_save = system_regs ++ vol_list - vol_list = case vols of Nothing -> []; Just regs -> regs + vol_list = case vols of Nothing -> all_of_em; Just regs -> regs + + all_of_em = [ VanillaReg n | n <- [0..mAX_Vanilla_REG] ] + ++ [ FloatReg n | n <- [0..mAX_Float_REG] ] + ++ [ DoubleReg n | n <- [0..mAX_Double_REG] ] + ++ [ LongReg n | n <- [0..mAX_Long_REG] ] callerSaveGlobalReg reg next | callerSaves reg =