diff options
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 4df47283448..0cdd37b9465 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3884,15 +3884,19 @@ 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 - && ! reg_set_p (XEXP (note, 0), PATTERN (undobuf.other_insn))) + if ((REG_NOTE_KIND (note) == REG_DEAD + && !reg_referenced_p (XEXP (note, 0), + PATTERN (undobuf.other_insn))) + ||(REG_NOTE_KIND (note) == REG_UNUSED + && !reg_set_p (XEXP (note, 0), + PATTERN (undobuf.other_insn)))) remove_note (undobuf.other_insn, note); } |