unroll.c (copy_loop_body): Remove REG_EQUAL note attached to copied instruction if...
authorDavid Edelsohn <edelsohn@gnu.org>
Sat, 5 Oct 2002 04:06:17 +0000 (04:06 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Sat, 5 Oct 2002 04:06:17 +0000 (00:06 -0400)
        * unroll.c (copy_loop_body): Remove REG_EQUAL note attached to
        copied instruction if the note is not loop invariant.

From-SVN: r57834

gcc/ChangeLog
gcc/unroll.c

index f01ea2b90d4f6a894c215f723fda942a8c271ca0..b6dcbca9d693d8d4dee5fd79f1b9f7da5ae4fe36 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-04  David Edelsohn  <edelsohn@gnu.org>
+
+       * unroll.c (copy_loop_body): Remove REG_EQUAL note attached to
+       copied instruction if the note is not loop invariant.
+
 2002-10-04  Loren J. Rittle  <ljrittle@acm.org>
 
        * gcc/ginclude/stddef.h: Support the FreeBSD 5 typedef system.
index 97e646eb25c7db5187bc61a2149dfb52956a830c..3e5ea7f069a8b1d56f17114256322d58251045e0 100644 (file)
@@ -2033,6 +2033,13 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
          REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
          INSN_SCOPE (copy) = INSN_SCOPE (insn);
 
+         /* If there is a REG_EQUAL note present whose value
+            is not loop invariant, then delete it, since it
+            may cause problems with later optimization passes.  */
+         if ((tem = find_reg_note (copy, REG_EQUAL, NULL_RTX))
+             && !loop_invariant_p (loop, XEXP (tem, 0)))
+           remove_note (copy, tem);
+
 #ifdef HAVE_cc0
          /* If this insn is setting CC0, it may need to look at
             the insn that uses CC0 to see what type of insn it is.