(distribute_notes): When search for new place to put REG_DEAD note,
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 19 Oct 1995 22:44:41 +0000 (18:44 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 19 Oct 1995 22:44:41 +0000 (18:44 -0400)
call distribute_links if this new place is between i2 and i3, and i2
uses the register.

From-SVN: r10475

gcc/combine.c

index 8e46de042ddb166803a30bc40129038aabefd51d..cd7dc12eb3e6b9afbcff54e08e504f128a95a310 100644 (file)
@@ -10779,6 +10779,21 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
                             && find_reg_fusage (tem, USE, XEXP (note, 0))))
                  {
                    place = tem;
+
+                   /* If we are doing a 3->2 combination, and we have a
+                      register which formerly died in i3 and was not used
+                      by i2, which now no longer dies in i3 and is used in
+                      i2 but does not die in i2, and place is between i2
+                      and i3, then we may need to move a link from place to
+                      i2.  */
+                   if (i2 && INSN_CUID (place) > INSN_CUID (i2)
+                       && from_insn && INSN_CUID (from_insn) > INSN_CUID (i2)
+                       && reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
+                     {
+                       rtx links = LOG_LINKS (place);
+                       LOG_LINKS (place) = 0;
+                       distribute_links (links);
+                     }
                    break;
                  }
                }