Fix Trac #959: a long-standing bug in instantiating otherwise-unbound type variables
[ghc-hetmet.git] / compiler / nativeGen / RegAlloc / Graph / SpillClean.hs
index 4f129c4..15fbb59 100644 (file)
@@ -42,7 +42,6 @@ import State
 import Outputable
 import Util
 
-import Data.Maybe
 import Data.List        ( find, nub )
 
 --
@@ -436,13 +435,16 @@ isStoreReg ss
 --
 instance Uniquable Store where
     getUnique (SReg  r)
-       | RealReg i     <- r
-       = mkUnique 'R' i
+       | RegReal (RealRegSingle i)     <- r
+       = mkRegSingleUnique i
+
+       | RegReal (RealRegPair r1 r2)   <- r
+       = mkRegPairUnique (r1 * 65535 + r2)
 
        | otherwise
        = error "RegSpillClean.getUnique: found virtual reg during spill clean, only real regs expected."
 
-    getUnique (SSlot i)                        = mkUnique 'S' i
+    getUnique (SSlot i)        = mkRegSubUnique i    -- [SLPJ] I hope "SubUnique" is ok
 
 instance Outputable Store where
        ppr (SSlot i)   = text "slot" <> int i