aboutsummaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2003-07-21 18:52:38 +0200
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-07-21 16:52:38 +0000
commitbbda30a4aae700f963fd164edbeac4f4688bf2a0 (patch)
tree012a183ac137fb8f46d0f240aabffa82cb691b8e /gcc/unroll.c
parent9ef2dd1fad3a6e04366c236a29d4377812e4bccd (diff)
downloadgcc-bbda30a4aae700f963fd164edbeac4f4688bf2a0.zip
gcc-bbda30a4aae700f963fd164edbeac4f4688bf2a0.tar.gz
gcc-bbda30a4aae700f963fd164edbeac4f4688bf2a0.tar.bz2
re PR rtl-optimization/11536 ([strength-reduce] -O2 optimalization produces wrong code)
PR optimization/11536 * unroll.c (loop_iterations): Do not replace a register holding the final value by its equivalent before the loop if it is not invariant. PR optimization/11536 * gcc.dg/20030721-1.c: New test. From-SVN: r69635
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 62b8152..1c66b13 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -3618,7 +3618,7 @@ loop_iterations (struct loop *loop)
if (find_common_reg_term (temp, reg2))
initial_value = temp;
- else
+ else if (loop_invariant_p (loop, reg2))
{
/* Find what reg2 is equivalent to. Hopefully it will
either be reg1 or reg1 plus a constant. Let's ignore