* combine.c (distribute_notes): When re-distributing the notes from
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Nov 2003 14:05:55 +0000 (14:05 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Nov 2003 14:05:55 +0000 (14:05 +0000)
an insn we are about to delete, ensure we can't end up with a cyclic
list of notes.

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

gcc/ChangeLog
gcc/combine.c

index 8fcf0a1..0199852 100644 (file)
@@ -1,3 +1,9 @@
+2003-11-13  Richard Earnshaw  <rearnsha@arm.com>
+
+       * combine.c (distribute_notes): When re-distributing the notes from
+       an insn we are about to delete, ensure we can't end up with a cyclic
+       list of notes.
+
 2003-11-13  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR optimization/12926
index c36d922..0fbaeba 100644 (file)
@@ -12702,11 +12702,12 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
                             This might delete other dead insns recursively.
                             First set the pattern to something that won't use
                             any register.  */
+                         rtx old_notes = REG_NOTES (tem);
 
                          PATTERN (tem) = pc_rtx;
+                         REG_NOTES (tem) = NULL;
 
-                         distribute_notes (REG_NOTES (tem), tem, tem,
-                                           NULL_RTX);
+                         distribute_notes (old_notes, tem, tem, NULL_RTX);
                          distribute_links (LOG_LINKS (tem));
 
                          PUT_CODE (tem, NOTE);
@@ -12718,10 +12719,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
                          if (cc0_setter)
                            {
                              PATTERN (cc0_setter) = pc_rtx;
+                             old_notes = REG_NOTES (cc0_setter);
+                             REG_NOTES (cc0_setter) = NULL;
 
-                             distribute_notes (REG_NOTES (cc0_setter),
-                                               cc0_setter, cc0_setter,
-                                               NULL_RTX);
+                             distribute_notes (old_notes, cc0_setter,
+                                               cc0_setter, NULL_RTX);
                              distribute_links (LOG_LINKS (cc0_setter));
 
                              PUT_CODE (cc0_setter, NOTE);