aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-02-12 08:49:55 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-02-12 08:49:55 +0000
commit62b0355332d6a102667074df1abf5e1a015809c6 (patch)
tree978e4087ca2bdbd4afd96388ab25a7caa8853cda /gcc/combine.c
parent6cfbc02310939961fdb3ca8db7d3fc0db42162d8 (diff)
downloadgcc-62b0355332d6a102667074df1abf5e1a015809c6.zip
gcc-62b0355332d6a102667074df1abf5e1a015809c6.tar.gz
gcc-62b0355332d6a102667074df1abf5e1a015809c6.tar.bz2
re PR rtl-optimization/60116 (wrong code at -Os on x86_64-linux-gnu in 32-bit mode)
PR rtl-optimization/60116 * combine.c (try_combine): Also remove dangling REG_DEAD notes on the other_insn once the combination has been validated. From-SVN: r207713
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index fd4294b..f6e1dbc 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -3894,14 +3894,15 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
PATTERN (undobuf.other_insn) = other_pat;
- /* If any of the notes in OTHER_INSN were REG_UNUSED, ensure that they
- are still valid. Then add any non-duplicate notes added by
- recog_for_combine. */
+ /* If any of the notes in OTHER_INSN were REG_DEAD or REG_UNUSED,
+ ensure that they are still valid. Then add any non-duplicate
+ notes added by recog_for_combine. */
for (note = REG_NOTES (undobuf.other_insn); note; note = next)
{
next = XEXP (note, 1);
- if (REG_NOTE_KIND (note) == REG_UNUSED
+ if ((REG_NOTE_KIND (note) == REG_DEAD
+ || REG_NOTE_KIND (note) == REG_UNUSED)
&& ! reg_set_p (XEXP (note, 0), PATTERN (undobuf.other_insn)))
remove_note (undobuf.other_insn, note);
}