summaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2014-02-10 09:25:44 -0700
committerJeff Law <law@gcc.gnu.org>2014-02-10 09:25:44 -0700
commitf27be5508a305c4e027b665157787b5ba8c99c62 (patch)
tree2b47eead162f5f28d55fcbb730993de7575ea7f2 /gcc/reload1.c
parent7606ae1a4b0abe87ae2fc7f33be840f2e88e1107 (diff)
downloadgcc-f27be5508a305c4e027b665157787b5ba8c99c62.tar.gz
re PR middle-end/52306 (ICE in cselib_record_set, at cselib.c:2158)
PR middle-end/52306 * reload1.c (emit_input_reload_insns): Do not create invalid RTL when changing the SET_DEST of a prior insn to avoid an input reload. PR middle-end-52306 * gcc.c-torture/compile/pr52306.c: New test. From-SVN: r207662
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index bb761fef7f7..b789ee8f19f 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -7362,9 +7362,18 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl,
/* Store into the reload register instead of the pseudo. */
SET_DEST (PATTERN (temp)) = reloadreg;
- /* Verify that resulting insn is valid. */
+ /* Verify that resulting insn is valid.
+
+ Note that we have replaced the destination of TEMP with
+ RELOADREG. If TEMP references RELOADREG within an
+ autoincrement addressing mode, then the resulting insn
+ is ill-formed and we must reject this optimization. */
extract_insn (temp);
- if (constrain_operands (1))
+ if (constrain_operands (1)
+#ifdef AUTO_INC_DEC
+ && ! find_reg_note (temp, REG_INC, reloadreg)
+#endif
+ )
{
/* If the previous insn is an output reload, the source is
a reload register, and its spill_reg_store entry will