From 27992bf89c008991fd6450b2b5bb224eda1f068a Mon Sep 17 00:00:00 2001 From: "Ben.Lippmeier@anu.edu.au" Date: Tue, 20 Jan 2009 07:51:00 +0000 Subject: [PATCH] SPARC NCG: Fix warnings --- compiler/nativeGen/MachCodeGen.hs | 4 ++++ compiler/nativeGen/RegAllocLinear.hs | 17 +++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/compiler/nativeGen/MachCodeGen.hs b/compiler/nativeGen/MachCodeGen.hs index e90b40c..325a4e8 100644 --- a/compiler/nativeGen/MachCodeGen.hs +++ b/compiler/nativeGen/MachCodeGen.hs @@ -3667,6 +3667,10 @@ genCCall target dest_regs argsAndHints = do | not $ isFloatType rep , W32 <- width = unitOL $ mkRegRegMoveInstr (RealReg $ oReg 0) r_dest + + | not $ isFloatType rep + , W64 <- width + = unitOL $ mkRegRegMoveInstr (RealReg $ oReg 0) r_dest in result diff --git a/compiler/nativeGen/RegAllocLinear.hs b/compiler/nativeGen/RegAllocLinear.hs index 5e25299..0a0162f 100644 --- a/compiler/nativeGen/RegAllocLinear.hs +++ b/compiler/nativeGen/RegAllocLinear.hs @@ -94,7 +94,6 @@ import MachInstrs import RegAllocInfo import RegLiveness import Cmm hiding (RegSet) -import PprMach import Digraph import Unique ( Uniquable(getUnique), Unique ) @@ -104,7 +103,6 @@ import UniqSupply import Outputable import State import FastString -import MonadUtils import Data.Maybe import Data.List @@ -112,8 +110,6 @@ import Control.Monad import Data.Word import Data.Bits -import Debug.Trace - #include "../includes/MachRegs.h" -- ----------------------------------------------------------------------------- @@ -206,7 +202,7 @@ initFreeRegs :: FreeRegs initFreeRegs = regs where - freeDouble = getFreeRegs RcDouble regs +-- freeDouble = getFreeRegs RcDouble regs regs = foldr releaseReg noFreeRegs allocable allocable = allocatableRegs \\ doublePairs doublePairs = [43, 45, 47, 49, 51, 53] @@ -223,15 +219,16 @@ getFreeRegs cls (FreeRegs g f d) go _ 0 _ = [] go x m i | x .&. m /= 0 = i : (go x (m `shiftL` 1) $! i+1) | otherwise = go x (m `shiftL` 1) $! i+1 - +{- showFreeRegs :: FreeRegs -> String showFreeRegs regs = "FreeRegs\n" ++ " integer: " ++ (show $ getFreeRegs RcInteger regs) ++ "\n" ++ " float: " ++ (show $ getFreeRegs RcFloat regs) ++ "\n" ++ " double: " ++ (show $ getFreeRegs RcDouble regs) ++ "\n" +-} - +{- -- | Check whether a reg is free regIsFree :: RegNo -> FreeRegs -> Bool regIsFree r (FreeRegs g f d) @@ -251,7 +248,7 @@ regIsFree r (FreeRegs g f d) | otherwise , mask <- 1 `shiftL` (fromIntegral r - 32) = f .&. mask /= 0 - +-} -- | Grab a register. grabReg :: RegNo -> FreeRegs -> FreeRegs @@ -316,7 +313,7 @@ releaseReg r regs@(FreeRegs g f d) -- | Allocate a register in the map. allocateReg :: RegNo -> FreeRegs -> FreeRegs -allocateReg r regs@(FreeRegs g f d) +allocateReg r regs -- (FreeRegs g f d) -- if the reg isn't actually free then we're in trouble {- | not $ regIsFree r regs @@ -820,7 +817,7 @@ allocateRegsAndSpill reading keep spills alloc (r:rs) = do case getFreeRegs (regClass r) freeregs of -- case (2): we have a free register - freeClass@(my_reg:_) -> {- pprTrace "alloc" (ppr r <+> ppr my_reg <+> ppr freeClass) $ -} + my_reg:_ -> {- pprTrace "alloc" (ppr r <+> ppr my_reg <+> ppr freeClass) $ -} do spills' <- loadTemp reading r loc my_reg spills let new_loc -- 1.7.10.4