summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-14 01:37:40 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-14 01:37:40 +0000
commitce53bb66f6870fce786908b522775ad890b580c6 (patch)
tree4f99dbb06bd95b603d114ce66f9c8f87a902e324
parent2959d9c3d3b035d1bf44d42f97c26780601c065f (diff)
downloadgcc-ce53bb66f6870fce786908b522775ad890b580c6.tar.gz
PRE_INC with invalid hard reg
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233406 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/reload.c12
2 files changed, 14 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0fce0c3bfe0..1561dbad282 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/reload.c b/gcc/reload.c
index 6196e63a16c..06426d92332 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -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)