From 7b8421337042b09c4a9cbc86a8528a43c316f677 Mon Sep 17 00:00:00 2001 From: rearnsha Date: Thu, 13 Nov 2003 14:05:55 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73547 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/combine.c | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8fcf0a1..0199852 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-11-13 Richard Earnshaw + + * 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 PR optimization/12926 diff --git a/gcc/combine.c b/gcc/combine.c index c36d922..0fbaeba 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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); -- 2.7.4