]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/7784 ([Sparc] ICE in extract_insn, at recog.c:2148)
authorUlrich Weigand <uweigand@de.ibm.com>
Sat, 29 Mar 2003 19:30:39 +0000 (19:30 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Sat, 29 Mar 2003 19:30:39 +0000 (19:30 +0000)
PR target/7784
* reload.c (maybe_memory_address_p): New function.
(find_reloads_address): Use it instead of memory_address_p.

From-SVN: r65020

gcc/ChangeLog
gcc/reload.c

index 5ad98717ff9b98666b1bff1fc954fc047045c2ce..e62c45bc413d99973f050dc9b05ed363b9b36d8e 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-29  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       PR target/7784
+       * reload.c (maybe_memory_address_p): New function.
+       (find_reloads_address): Use it instead of memory_address_p.
+
 2003-03-29  Alan Modra  <amodra@bigpond.net.au>
 
        * config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Respect
index a27da24982752dc0b6473ce680467827c4c43f4f..3e0e2ad999a05989b1ebd65a7536f3ef83b8a13c 100644 (file)
@@ -257,6 +257,7 @@ static int alternative_allows_memconst PARAMS ((const char *, int));
 static rtx find_reloads_toplev PARAMS ((rtx, int, enum reload_type, int,
                                         int, rtx, int *));
 static rtx make_memloc         PARAMS ((rtx, int));
+static int maybe_memory_address_p PARAMS ((enum machine_mode, rtx, rtx *));
 static int find_reloads_address        PARAMS ((enum machine_mode, rtx *, rtx, rtx *,
                                       int, enum reload_type, int, rtx));
 static rtx subst_reg_equivs    PARAMS ((rtx, rtx));
@@ -4545,6 +4546,27 @@ make_memloc (ad, regno)
   return tem;
 }
 
+/* Returns true if AD could be turned into a valid memory reference
+   to mode MODE by reloading the part pointed to by PART into a 
+   register.  */
+
+static int
+maybe_memory_address_p (mode, ad, part)
+     enum machine_mode mode;
+     rtx ad;
+     rtx *part;
+{
+  int retv;
+  rtx tem = *part;
+  rtx reg = gen_rtx_REG (GET_MODE (tem), max_reg_num ());
+
+  *part = reg;
+  retv = memory_address_p (mode, ad);
+  *part = tem;
+
+  return retv;
+}
+
 /* Record all reloads needed for handling memory address AD
    which appears in *LOC in a memory reference to mode MODE
    which itself is found in location  *MEMREFLOC.
@@ -4842,7 +4864,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
           && GET_CODE (XEXP (XEXP (ad, 0), 0)) == REG
           && REGNO (XEXP (XEXP (ad, 0), 0)) < FIRST_PSEUDO_REGISTER
           && REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 0), mode)
-          && ! memory_address_p (mode, ad))
+          && ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 1)))
     {
       *loc = ad = gen_rtx_PLUS (GET_MODE (ad),
                                plus_constant (XEXP (XEXP (ad, 0), 0),
@@ -4862,7 +4884,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
           && GET_CODE (XEXP (XEXP (ad, 0), 1)) == REG
           && REGNO (XEXP (XEXP (ad, 0), 1)) < FIRST_PSEUDO_REGISTER
           && REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 1), mode)
-          && ! memory_address_p (mode, ad))
+          && ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 0)))
     {
       *loc = ad = gen_rtx_PLUS (GET_MODE (ad),
                                XEXP (XEXP (ad, 0), 0),