OSDN Git Service

(scan_loop): For the replace_rtx call, copy the rtx that is
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jan 1995 01:30:34 +0000 (01:30 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jan 1995 01:30:34 +0000 (01:30 +0000)
being substituted in before the call.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8779 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/loop.c

index bb48a9e..e267652 100644 (file)
@@ -746,10 +746,12 @@ scan_loop (loop_start, end, nregs)
                  && validate_replace_rtx (SET_DEST (set), SET_SRC (set),
                                           reg_single_usage[regno]))
                {
-                 /* Replace any usage in a REG_EQUAL note.  */
+                 /* Replace any usage in a REG_EQUAL note.  Must copy the
+                    new source, so that we don't get rtx sharing between the
+                    SET_SOURCE and REG_NOTES of insn p.  */
                  REG_NOTES (reg_single_usage[regno])
                    = replace_rtx (REG_NOTES (reg_single_usage[regno]),
-                                  SET_DEST (set), SET_SRC (set));
+                                  SET_DEST (set), copy_rtx (SET_SRC (set)));
                                   
                  PUT_CODE (p, NOTE);
                  NOTE_LINE_NUMBER (p) = NOTE_INSN_DELETED;