diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-19 20:47:12 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-19 20:47:12 +0000 |
commit | a821a12be7c36444c7e9d00b33a55ed21ea3ded3 (patch) | |
tree | 470043d1de55a51cee45090944a3b15b2bdddf2b /gcc/loop.c | |
parent | 72381a64630f6002024b62ebcefb0b2a386e01fd (diff) | |
download | gcc-a821a12be7c36444c7e9d00b33a55ed21ea3ded3.tar.gz |
PR optimization/8988
* loop.c (maybe_eliminate_biv): Kill REG_EQUAL notes mentioning
the biv when eliminating.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60334 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/loop.c b/gcc/loop.c index b3a8d2818d5..b0ce7cd9d43 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -8612,11 +8612,12 @@ maybe_eliminate_biv (loop, bl, eliminate_p, threshold, insn_count) enum rtx_code code = GET_CODE (p); basic_block where_bb = 0; rtx where_insn = threshold >= insn_count ? 0 : p; + rtx note; /* If this is a libcall that sets a giv, skip ahead to its end. */ if (GET_RTX_CLASS (code) == 'i') { - rtx note = find_reg_note (p, REG_LIBCALL, NULL_RTX); + note = find_reg_note (p, REG_LIBCALL, NULL_RTX); if (note) { @@ -8634,6 +8635,8 @@ maybe_eliminate_biv (loop, bl, eliminate_p, threshold, insn_count) } } } + + /* Closely examine the insn if the biv is mentioned. */ if ((code == INSN || code == JUMP_INSN || code == CALL_INSN) && reg_mentioned_p (reg, PATTERN (p)) && ! maybe_eliminate_biv_1 (loop, PATTERN (p), p, bl, @@ -8645,6 +8648,12 @@ maybe_eliminate_biv (loop, bl, eliminate_p, threshold, insn_count) bl->regno, INSN_UID (p)); break; } + + /* If we are eliminating, kill REG_EQUAL notes mentioning the biv. */ + if (eliminate_p + && (note = find_reg_note (p, REG_EQUAL, NULL_RTX)) != NULL_RTX + && reg_mentioned_p (reg, XEXP (note, 0))) + remove_note (p, note); } if (p == loop->end) |