aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-08-18 11:09:33 -0700
committerJim Wilson <wilson@gcc.gnu.org>1994-08-18 11:09:33 -0700
commit07d0cbddd457e587413cc203a724165676855099 (patch)
tree8dc5f8fa7ec9d2fed443ac00751555e824560565
parent0179115349c9520a592a9981716ccbf5062169e6 (diff)
downloadgcc-07d0cbddd457e587413cc203a724165676855099.zip
gcc-07d0cbddd457e587413cc203a724165676855099.tar.gz
gcc-07d0cbddd457e587413cc203a724165676855099.tar.bz2
(distribute_notes...
(distribute_notes, case REG_UNUSED): Ignore notes when from_insn != i3 only if the notes would remain as REG_UNUSED notes. From-SVN: r7942
-rw-r--r--gcc/combine.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 275b94b..a4913ae 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10342,10 +10342,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
switch (REG_NOTE_KIND (note))
{
case REG_UNUSED:
- /* If this note is from any insn other than i3, then we have no
- use for it, and must ignore it.
-
- Any clobbers for i3 may still exist, and so we must process
+ /* Any clobbers for i3 may still exist, and so we must process
REG_UNUSED notes from that insn.
Any clobbers from i2 or i1 can only exist if they were added by
@@ -10355,14 +10352,18 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if it is for the same register as the original i3 dest.
In that case, we will notice that the register is set in i3,
and then add a REG_UNUSED note for the destination of i3, which
- is wrong. */
- if (from_insn != i3)
- break;
+ is wrong. However, it is possible to have REG_UNUSED notes from
+ i2 or i1 for register which were both used and clobbered, so
+ we keep notes from i2 or i1 if they will turn into REG_DEAD
+ notes. */
/* If this register is set or clobbered in I3, put the note there
unless there is one already. */
- else if (reg_set_p (XEXP (note, 0), PATTERN (i3)))
+ if (reg_set_p (XEXP (note, 0), PATTERN (i3)))
{
+ if (from_insn != i3)
+ break;
+
if (! (GET_CODE (XEXP (note, 0)) == REG
? find_regno_note (i3, REG_UNUSED, REGNO (XEXP (note, 0)))
: find_reg_note (i3, REG_UNUSED, XEXP (note, 0))))