summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-17 13:35:59 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-17 13:35:59 +0000
commitecec2a9d0a1274a8c9b306f81bd7bd70cb494954 (patch)
tree7447583b489738be9329dc52cea9006141c36e53 /gcc/loop.c
parentd8330ae2f09528ae910875a9a338600351d129ef (diff)
downloadgcc-ecec2a9d0a1274a8c9b306f81bd7bd70cb494954.tar.gz
* loop.c (strength_reduce): When doing biv->giv conversion, update
reg note of NEXT->insn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27574 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index dcddba681b4..7bd014786f0 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -4198,7 +4198,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
for (vp = &bl->biv, next = *vp; v = next, next = v->next_iv;)
{
HOST_WIDE_INT offset;
- rtx set, add_val, old_reg, dest_reg, last_use_insn;
+ rtx set, add_val, old_reg, dest_reg, last_use_insn, note;
int old_regno, new_regno;
if (! v->always_executed
@@ -4304,7 +4304,13 @@ strength_reduce (scan_start, end, loop_top, insn_count,
REG_IV_TYPE (new_regno) = GENERAL_INDUCT;
REG_IV_INFO (new_regno) = v;
-
+
+ /* If next_insn has a REG_EQUAL note that mentiones OLD_REG,
+ it must be replaced. */
+ note = find_reg_note (next->insn, REG_EQUAL, NULL_RTX);
+ if (note && reg_mentioned_p (old_reg, XEXP (note, 0)))
+ XEXP (note, 0) = copy_rtx (SET_SRC (single_set (next->insn)));
+
/* Remove the increment from the list of biv increments,
and record it as a giv. */
*vp = next;