aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2010-05-22 13:15:37 +0400
committerAnatoly Sokolov <aesok@gcc.gnu.org>2010-05-22 13:15:37 +0400
commit277e2873445daf04f771eacf8636ba15671dfeda (patch)
tree880b017c21d9882c2137dfb3a9a3490a348c4e9e /gcc
parent0350c97ebe00dfbf26b15ddd027d02007324d7ea (diff)
downloadgcc-277e2873445daf04f771eacf8636ba15671dfeda.zip
gcc-277e2873445daf04f771eacf8636ba15671dfeda.tar.gz
gcc-277e2873445daf04f771eacf8636ba15671dfeda.tar.bz2
sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
* config/sparc/sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove. * config/sparc/sparc.c (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. (sparc_mode_dependent_address_p): New function. From-SVN: r159694
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sparc/sparc.c32
-rw-r--r--gcc/config/sparc/sparc.h27
3 files changed, 38 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1d6d14b..d6b9876 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-22 Anatoly Sokolov <aesok@post.ru>
+
+ * config/sparc/sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
+ * config/sparc/sparc.c (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
+ (sparc_mode_dependent_address_p): New function.
+
2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
* Makefile.in: Fix c-pch.o and ggc-common.o dependencies on timevars.
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 10502e0..26c96c4 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -412,6 +412,7 @@ static bool sparc_tls_referenced_p (rtx);
static rtx legitimize_tls_address (rtx);
static rtx legitimize_pic_address (rtx, rtx);
static rtx sparc_legitimize_address (rtx, rtx, enum machine_mode);
+static bool sparc_mode_dependent_address_p (const_rtx);
static bool sparc_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, const_tree, bool);
static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *,
@@ -499,6 +500,8 @@ static bool fpu_option_set = false;
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS sparc_legitimize_address
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P sparc_mode_dependent_address_p
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN sparc_expand_builtin
@@ -3519,6 +3522,35 @@ sparc_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
return x;
}
+/* Return true 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). */
+
+
+static bool
+sparc_mode_dependent_address_p (const_rtx addr)
+{
+ if (flag_pic && GET_CODE (addr) == PLUS)
+ {
+ rtx op0 = XEXP (addr, 0);
+ rtx op1 = XEXP (addr, 1);
+ if (op0 == pic_offset_table_rtx
+ && SYMBOLIC_CONST (op1))
+ return true;
+ }
+
+ return false;
+}
+
#ifdef HAVE_GAS_HIDDEN
# define USE_HIDDEN_LINKONCE 1
#else
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index bd9daa5..34cb8e3 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1835,33 +1835,6 @@ do { \
#define RTX_OK_FOR_OLO10_P(X) \
(GET_CODE (X) == CONST_INT && INTVAL (X) >= -0x1000 && INTVAL (X) < 0xc00 - 8)
-/* 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 a machine-dependent way of reloading an illegitimate address
operand. If we find one, push the reload and jump to WIN. This