]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PRE_INC with invalid hard reg
authorAlan Modra <amodra@gmail.com>
Sun, 14 Feb 2016 01:37:40 +0000 (12:07 +1030)
committerAlan Modra <amodra@gcc.gnu.org>
Sun, 14 Feb 2016 01:37:40 +0000 (12:07 +1030)
PR target/68973
* reloads.c (find_reloads_address_1): For pre/post-inc/dec
with an invalid hard reg, reload just the reg not the entire
pre/post-inc/dec address expression.

From-SVN: r233406

gcc/ChangeLog
gcc/reload.c

index 0fce0c3bfe00577462f0dcddb52a5a8c8b7bb69d..1561dbad2827d2ef47178c7d4083f06bda38a331 100644 (file)
@@ -1,3 +1,10 @@
+2016-02-14  Alan Modra  <amodra@gmail.com>
+
+       PR target/68973
+       * reloads.c (find_reloads_address_1): For pre/post-inc/dec
+       with an invalid hard reg, reload just the reg not the entire
+       pre/post-inc/dec address expression.
+
 2016-02-13  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/67260
index 6196e63a16c6df367921d17d4d0b6202ecd6b3a8..06426d92332d18b26bd4d5a5de069553b163b7a2 100644 (file)
@@ -5834,14 +5834,16 @@ find_reloads_address_1 (machine_mode mode, addr_space_t as,
                           ? XEXP (x, 0)
                           : reg_equiv_mem (regno));
              enum insn_code icode = optab_handler (add_optab, GET_MODE (x));
-             if (insn && NONJUMP_INSN_P (insn) && equiv
-                 && memory_operand (equiv, GET_MODE (equiv))
+             if (insn && NONJUMP_INSN_P (insn)
 #if HAVE_cc0
                  && ! sets_cc0_p (PATTERN (insn))
 #endif
-                 && ! (icode != CODE_FOR_nothing
-                       && insn_operand_matches (icode, 0, equiv)
-                       && insn_operand_matches (icode, 1, equiv))
+                 && (regno < FIRST_PSEUDO_REGISTER
+                     || (equiv
+                         && memory_operand (equiv, GET_MODE (equiv))
+                         && ! (icode != CODE_FOR_nothing
+                               && insn_operand_matches (icode, 0, equiv)
+                               && insn_operand_matches (icode, 1, equiv))))
                  /* Using RELOAD_OTHER means we emit this and the reload we
                     made earlier in the wrong order.  */
                  && !reloaded_inner_of_autoinc)