OSDN Git Service

* config/sparc/sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 May 2010 09:15:37 +0000 (09:15 +0000)
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 May 2010 09:15:37 +0000 (09:15 +0000)
* config/sparc/sparc.c (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
(sparc_mode_dependent_address_p): New function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159694 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h

index 1d6d14b..d6b9876 100644 (file)
@@ -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.
index 10502e0..26c96c4 100644 (file)
@@ -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
index bd9daa5..34cb8e3 100644 (file)
@@ -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;                                 \
-       }                                               \
-    }                                                  \
-}
 \f
 /* Try a machine-dependent way of reloading an illegitimate address
    operand.  If we find one, push the reload and jump to WIN.  This