Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6ed684b35af3045a41e34b4f8a0b6dd05a6eb700

>---------------------------------------------------------------

commit 6ed684b35af3045a41e34b4f8a0b6dd05a6eb700
Author: Paolo Capriotti <[email protected]>
Date:   Tue Jul 10 10:36:03 2012 +0100

    Fix overlapping patterns warning (#7065)

>---------------------------------------------------------------

 compiler/nativeGen/X86/Regs.hs |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/compiler/nativeGen/X86/Regs.hs b/compiler/nativeGen/X86/Regs.hs
index b2b6a34..ea0fd61 100644
--- a/compiler/nativeGen/X86/Regs.hs
+++ b/compiler/nativeGen/X86/Regs.hs
@@ -404,7 +404,7 @@ xmm n = regSingle (firstxmm+n)
 
 
 -- horror show 
-----------------------------------------------------------------
-freeReg                 :: RegNo -> FastBool
+freeReg, freeRegBase    :: RegNo -> FastBool
 globalRegMaybe          :: GlobalReg -> Maybe RealReg
 allArgRegs              :: [(Reg, Reg)]
 allIntArgRegs           :: [Reg]
@@ -480,26 +480,28 @@ freeReg edi = fastBool False
 freeReg rsp = fastBool False  --        %rsp is the C stack pointer
 #endif
 
+-- split patterns in two functions to prevent overlaps
+freeReg r         = freeRegBase r
+
 #ifdef REG_Base
-freeReg REG_Base = fastBool False
+freeRegBase REG_Base = fastBool False
 #endif
 #ifdef REG_Sp
-freeReg REG_Sp   = fastBool False
+freeRegBase REG_Sp   = fastBool False
 #endif
 #ifdef REG_SpLim
-freeReg REG_SpLim = fastBool False
+freeRegBase REG_SpLim = fastBool False
 #endif
 #ifdef REG_Hp
-freeReg REG_Hp   = fastBool False
+freeRegBase REG_Hp   = fastBool False
 #endif
 #ifdef REG_HpLim
-freeReg REG_HpLim = fastBool False
+freeRegBase REG_HpLim = fastBool False
 #endif
 
 -- All other regs are considered to be "free", because we can track
 -- their liveness accurately.
-freeReg _         = fastBool True
-
+freeRegBase _ = fastBool True
 
 --  | Returns 'Nothing' if this global register is not stored
 -- in a real machine register, otherwise returns @'Just' reg@, where



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to