summaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 6976ebae6ed..c09f036eb5f 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -3540,6 +3540,11 @@ loop_find_equiv_value (loop, reg)
ret = XEXP (note, 0);
else
ret = SET_SRC (set);
+
+ /* We cannot do this if it changes between the
+ assignment and loop start though. */
+ if (modified_between_p (ret, insn, loop_start))
+ ret = reg;
}
break;
}