[project @ 1996-01-11 14:06:51 by partain]
[ghc-hetmet.git] / ghc / compiler / nativeGen / SparcCode.lhs
index 1c3862e..e068093 100644 (file)
@@ -339,6 +339,7 @@ pprAddr sty (AddrRegReg r1 r2) =
 
 pprAddr sty (AddrRegImm r1 (ImmInt i))
     | i == 0 = pprReg r1
+    | i < -4096 || i > 4095 = large_offset_error i
     | i < 0  =
        uppBesides [
            pprReg r1,
@@ -348,6 +349,7 @@ pprAddr sty (AddrRegImm r1 (ImmInt i))
 
 pprAddr sty (AddrRegImm r1 (ImmInteger i))
     | i == 0 = pprReg r1
+    | i < -4096 || i > 4095 = large_offset_error i
     | i < 0  =
        uppBesides [
            pprReg r1,
@@ -362,6 +364,9 @@ pprAddr sty (AddrRegImm r1 imm) =
        pprImm sty imm
     ]
 
+large_offset_error i
+  = error ("ERROR: SPARC native-code generator cannot handle large offset ("++show i++");\nprobably because of large constant data structures;\nworkaround: use -fvia-C on this module.\n")
+
 pprRI :: PprStyle -> RI -> Unpretty
 pprRI sty (RIReg r) = pprReg r
 pprRI sty (RIImm r) = pprImm sty r
@@ -1098,7 +1103,7 @@ baseRegOffset SuB                 = OFFSET_SuB
 baseRegOffset Hp                       = OFFSET_Hp
 baseRegOffset HpLim                    = OFFSET_HpLim
 baseRegOffset LivenessReg              = OFFSET_Liveness
-baseRegOffset ActivityReg              = OFFSET_Activity
+--baseRegOffset ActivityReg            = OFFSET_Activity
 #ifdef DEBUG
 baseRegOffset BaseReg                  = panic "baseRegOffset:BaseReg"
 baseRegOffset StdUpdRetVecReg          = panic "baseRegOffset:StgUpdRetVecReg"
@@ -1184,7 +1189,7 @@ callerSaves HpLim                 = True
 callerSaves LivenessReg                = True
 #endif
 #ifdef CALLER_SAVES_Activity
-callerSaves ActivityReg                = True
+--callerSaves ActivityReg              = True
 #endif
 #ifdef CALLER_SAVES_StdUpdRetVec
 callerSaves StdUpdRetVecReg            = True
@@ -1271,7 +1276,7 @@ stgRegMap HpLim              = Just (FixedReg ILIT(REG_HpLim))
 stgRegMap LivenessReg     = Just (FixedReg ILIT(REG_Liveness))
 #endif
 #ifdef REG_Activity
-stgRegMap ActivityReg     = Just (FixedReg ILIT(REG_Activity))
+--stgRegMap ActivityReg           = Just (FixedReg ILIT(REG_Activity))
 #endif
 #ifdef REG_StdUpdRetVec
 stgRegMap StdUpdRetVecReg  = Just (FixedReg ILIT(REG_StdUpdRetVec))
@@ -1372,7 +1377,7 @@ freeReg ILIT(REG_HpLim) = _FALSE_
 freeReg ILIT(REG_Liveness) = _FALSE_
 #endif
 #ifdef REG_Activity
-freeReg ILIT(REG_Activity) = _FALSE_
+--freeReg ILIT(REG_Activity) = _FALSE_
 #endif
 #ifdef REG_StdUpdRetVec
 freeReg ILIT(REG_StdUpdRetVec) = _FALSE_