aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/sparc/sparc.h38
2 files changed, 42 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 118ff21..2178dac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2003-03-21 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Richard Henderson <rth@redhat.com>
+
+ PR optimization/8366
+ * config/sparc/sparc.h: (SYMBOLIC_CONST): New macro.
+ (GO_IF_LEGITIMATE_ADDRESS): Use it. Reject the form
+ PIC+SYMBOLIC_CONST in other modes than Pmode.
+ (GO_IF_MODE_DEPENDENT_ADDRESS): Use it. Mark
+ the form PIC+SYMBOLIC_CONST as mode dependent.
+
2003-03-21 DJ Delorie <dj@redhat.com>
* config/stormy16/stormy16.c (xstormy16_expand_arith): Make
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index a41f6b5..2e47ba4 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2180,6 +2180,8 @@ do { \
If you change this, execute "rm explow.o recog.o reload.o". */
+#define SYMBOLIC_CONST(X) symbolic_operand (X, VOIDmode)
+
#define RTX_OK_FOR_BASE_P(X) \
((GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \
|| (GET_CODE (X) == SUBREG \
@@ -2213,6 +2215,8 @@ do { \
&& GET_CODE (op1) != REG \
&& GET_CODE (op1) != LO_SUM \
&& GET_CODE (op1) != MEM \
+ && (! SYMBOLIC_CONST (op1) \
+ || MODE == Pmode) \
&& (GET_CODE (op1) != CONST_INT \
|| SMALL_INT (op1))) \
goto ADDR; \
@@ -2300,6 +2304,34 @@ do { \
else if (GET_CODE (X) == CONST_INT && SMALL_INT (X)) \
goto ADDR; \
}
+
+/* Go to LABEL if ADDR (a legitimate address expression)
+ has an effect that depends on the machine mode it is used for.
+
+ In PIC mode,
+
+ (mem:HI [%l7+a])
+
+ is not equivalent to
+
+ (mem:QI [%l7+a]) (mem:QI [%l7+a+1])
+
+ because [%l7+a+1] is interpreted as the address of (a+1). */
+
+#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
+{ \
+ if (flag_pic == 1) \
+ { \
+ if (GET_CODE (ADDR) == PLUS) \
+ { \
+ rtx op0 = XEXP (ADDR, 0); \
+ rtx op1 = XEXP (ADDR, 1); \
+ if (op0 == pic_offset_table_rtx \
+ && SYMBOLIC_CONST (op1)) \
+ goto LABEL; \
+ } \
+ } \
+}
/* Try machine-dependent ways of modifying an illegitimate address
to be legitimate. If we find one, return the new, valid address.
@@ -2377,12 +2409,6 @@ do { \
} \
/* ??? 64-bit reloads. */ \
} while (0)
-
-/* Go to LABEL if ADDR (a legitimate address expression)
- has an effect that depends on the machine mode it is used for.
- On the SPARC this is never true. */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */