]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/53021 (bootstrap failure on Linux/ia32)
authorRichard Sandiford <rdsandiford@googlemail.com>
Sat, 21 Apr 2012 18:55:18 +0000 (18:55 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 21 Apr 2012 18:55:18 +0000 (18:55 +0000)
gcc/
PR bootstrap/53021
* rtl.def (ADDRESS): Use "i" rather than "w".
* rtl.h (find_base_term): Delete.
(may_be_sp_based_p): Declare.
* rtl.c (rtx_code_size): Remove ADDRESS special case.
* alias.h (UNIQUE_BASE_VALUE_SP, UNIQUE_BASE_VALUE_ARGP)
(UNIQUE_BASE_VALUE_FP, UNIQUE_BASE_VALUE_HFP): Move to...
* alias.c: ...here.
(find_base_term): Make static.
(may_be_sp_based_p): New function.
* dse.c (record_store): Use it.
* store-motion.c (store_killed_in_insn): Likewise.

From-SVN: r186657

gcc/ChangeLog
gcc/alias.c
gcc/alias.h
gcc/dse.c
gcc/rtl.c
gcc/rtl.def
gcc/rtl.h
gcc/store-motion.c

index ab7ad93ad1230d35632d6c6e545f0d61c26dc07a..9133f1bb7bfaf0db98626c628cc16cd01467de91 100644 (file)
@@ -1,3 +1,18 @@
+2012-04-21  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       PR bootstrap/53021
+       * rtl.def (ADDRESS): Use "i" rather than "w".
+       * rtl.h (find_base_term): Delete.
+       (may_be_sp_based_p): Declare.
+       * rtl.c (rtx_code_size): Remove ADDRESS special case.
+       * alias.h (UNIQUE_BASE_VALUE_SP, UNIQUE_BASE_VALUE_ARGP)
+       (UNIQUE_BASE_VALUE_FP, UNIQUE_BASE_VALUE_HFP): Move to...
+       * alias.c: ...here.
+       (find_base_term): Make static.
+       (may_be_sp_based_p): New function.
+       * dse.c (record_store): Use it.
+       * store-motion.c (store_killed_in_insn): Likewise.
+
 2012-04-21  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * fold-const.c (fold_checksum_tree): Fix VECTOR_CST case.
index 7b1986c0923e3e296c881bcd531a2e48112ef069..8366f9c3a5e16aa4919b0e64efda645f1cc13c8a 100644 (file)
@@ -228,6 +228,13 @@ static int unique_id;
    array.  */
 static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value;
 
+/* Values of XINT (address, 0) of Pmode ADDRESS rtxes for special
+   registers.  */
+#define UNIQUE_BASE_VALUE_SP   -1
+#define UNIQUE_BASE_VALUE_ARGP -2
+#define UNIQUE_BASE_VALUE_FP   -3
+#define UNIQUE_BASE_VALUE_HFP  -4
+
 #define static_reg_base_value \
   (this_target_rtl->x_static_reg_base_value)
 
@@ -1584,7 +1591,7 @@ rtx_equal_for_memref_p (const_rtx x, const_rtx y)
   return 1;
 }
 
-rtx
+static rtx
 find_base_term (rtx x)
 {
   cselib_val *val;
@@ -1740,6 +1747,16 @@ find_base_term (rtx x)
     }
 }
 
+/* Return true if accesses to address X may alias accesses based
+   on the stack pointer.  */
+
+bool
+may_be_sp_based_p (rtx x)
+{
+  rtx base = find_base_term (x);
+  return !base || base == static_reg_base_value[STACK_POINTER_REGNUM];
+}
+
 /* Return 0 if the addresses X and Y are known to point to different
    objects, 1 if they might be pointers to the same object.  */
 
index d4dd3038292faaefb603e4f36ad6cee96f6d523b..9e0d1872658d506a78d02d0602ce3f2cb77aab0d 100644 (file)
@@ -51,11 +51,4 @@ extern int nonoverlapping_memrefs_p (const_rtx, const_rtx, bool);
    memory barriers, including an address of SCRATCH.  */
 #define ALIAS_SET_MEMORY_BARRIER       ((alias_set_type) -1)
 
-/* Values of XWINT (address, 0) of Pmode ADDRESS rtxes for special
-   registers.  */
-#define UNIQUE_BASE_VALUE_SP   -1
-#define UNIQUE_BASE_VALUE_ARGP -2
-#define UNIQUE_BASE_VALUE_FP   -3
-#define UNIQUE_BASE_VALUE_HFP  -4
-
 #endif /* GCC_ALIAS_H */
index 9f57613d5141a588114e744770bbe2a0bc03ac81..19d938301bb989e82040c198fd72ba0e1c17190e 100644 (file)
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1499,11 +1499,7 @@ record_store (rtx body, bb_info_t bb_info)
     }
   else
     {
-      rtx base_term = find_base_term (XEXP (mem, 0));
-      if (!base_term
-         || (GET_CODE (base_term) == ADDRESS
-             && GET_MODE (base_term) == Pmode
-             && XWINT (base_term, 0) == UNIQUE_BASE_VALUE_SP))
+      if (may_be_sp_based_p (XEXP (mem, 0)))
        insn_info->stack_pointer_based = true;
       insn_info->contains_cselib_groups = true;
 
index 9ca6da2c1f60ad212a9a7ee09f1b95a12fcefc89..ec48839f61e1ac137eda3b15d71f8f4917193f3c 100644 (file)
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -111,7 +111,7 @@ const enum rtx_class rtx_class[NUM_RTX_CODE] = {
 const unsigned char rtx_code_size[NUM_RTX_CODE] = {
 #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)                                \
   (((ENUM) == CONST_INT || (ENUM) == CONST_DOUBLE                      \
-    || (ENUM) == CONST_FIXED || (ENUM) == ADDRESS)                     \
+    || (ENUM) == CONST_FIXED)                                          \
    ? RTX_HDR_SIZE + (sizeof FORMAT - 1) * sizeof (HOST_WIDE_INT)       \
    : RTX_HDR_SIZE + (sizeof FORMAT - 1) * sizeof (rtunion)),
 
index 83326b31f551b7752ac15768e83fb68a16c5cdb0..955e8e4709b64e892cd3a2055e32e01dccca8179 100644 (file)
@@ -110,7 +110,7 @@ DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA)
 DEF_RTL_EXPR(SEQUENCE, "sequence", "E", RTX_EXTRA)
 
 /* Represents a non-global base address.  This is only used in alias.c.  */
-DEF_RTL_EXPR(ADDRESS, "address", "w", RTX_EXTRA)
+DEF_RTL_EXPR(ADDRESS, "address", "i", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Expression types used for things in the instruction chain.
index 795a75f1a9c8d102a92bdf4b3cb4a7d00075411e..1da1792d1a31d72a429b583066701712a69527a6 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2597,7 +2597,7 @@ extern void init_alias_analysis (void);
 extern void end_alias_analysis (void);
 extern void vt_equate_reg_base_value (const_rtx, const_rtx);
 extern bool memory_modified_in_insn_p (const_rtx, const_rtx);
-extern rtx find_base_term (rtx);
+extern bool may_be_sp_based_p (rtx);
 extern rtx gen_hard_reg_clobber (enum machine_mode, unsigned int);
 extern rtx get_reg_known_value (unsigned int);
 extern bool get_reg_known_equiv_p (unsigned int);
index 03b2c3d4c841afd6362c8588c9441ef07e1474b4..e00cb16d16f690e50f44e56ab175f9ef35b60173 100644 (file)
@@ -395,7 +395,7 @@ store_killed_in_pat (const_rtx x, const_rtx pat, int after)
 static bool
 store_killed_in_insn (const_rtx x, const_rtx x_regs, const_rtx insn, int after)
 {
-  const_rtx reg, base, note, pat;
+  const_rtx reg, note, pat;
 
   if (! NONDEBUG_INSN_P (insn))
     return false;
@@ -410,14 +410,8 @@ store_killed_in_insn (const_rtx x, const_rtx x_regs, const_rtx insn, int after)
       /* But even a const call reads its parameters.  Check whether the
         base of some of registers used in mem is stack pointer.  */
       for (reg = x_regs; reg; reg = XEXP (reg, 1))
-       {
-         base = find_base_term (XEXP (reg, 0));
-         if (!base
-             || (GET_CODE (base) == ADDRESS
-                 && GET_MODE (base) == Pmode
-                 && XEXP (base, 0) == stack_pointer_rtx))
-           return true;
-       }
+       if (may_be_sp_based_p (XEXP (reg, 0)))
+         return true;
 
       return false;
     }