From: Josef Zlomek Date: Tue, 5 Aug 2003 04:22:05 +0000 (+0200) Subject: * gcse.c (try_replace_reg): Fix updating of note. X-Git-Tag: releases/gcc-3.4.0~4388 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed8395a03db5445a6763771dca20cc6836f3ee5f;p=thirdparty%2Fgcc.git * gcse.c (try_replace_reg): Fix updating of note. From-SVN: r70168 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 60bfb0289e43..8a2653cf736a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-08-05 Josef Zlomek + + * gcse.c (try_replace_reg): Fix updating of note. + 2003-08-04 Roger Sayle PR middle-end/11771 diff --git a/gcc/gcse.c b/gcc/gcse.c index e8c5f9a79291..06f7fd9efa0e 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -3849,6 +3849,11 @@ try_replace_reg (rtx from, rtx to, rtx insn) validate_change (insn, &SET_SRC (set), src, 0); } + /* If there is already a NOTE, update the expression in it with our + replacement. */ + if (note != 0) + XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to); + if (!success && set && reg_mentioned_p (from, SET_SRC (set))) { /* If above failed and this is a single set, try to simplify the source of @@ -3869,11 +3874,6 @@ try_replace_reg (rtx from, rtx to, rtx insn) note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src)); } - /* If there is already a NOTE, update the expression in it with our - replacement. */ - else if (note != 0) - XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to); - /* REG_EQUAL may get simplified into register. We don't allow that. Remove that note. This code ought not to happen, because previous code ought to synthesize