summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/unroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/unroll.c')
-rw-r--r--contrib/gcc/unroll.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/contrib/gcc/unroll.c b/contrib/gcc/unroll.c
index 590cc94..5a15208 100644
--- a/contrib/gcc/unroll.c
+++ b/contrib/gcc/unroll.c
@@ -2478,7 +2478,13 @@ biv_total_increment (bl)
if (v->always_computable && v->mult_val == const1_rtx
&& ! v->maybe_multiple
&& SCALAR_INT_MODE_P (v->mode))
- result = fold_rtx_mult_add (result, const1_rtx, v->add_val, v->mode);
+ {
+ /* If we have already counted it, skip it. */
+ if (v->same)
+ continue;
+
+ result = fold_rtx_mult_add (result, const1_rtx, v->add_val, v->mode);
+ }
else
return 0;
}
@@ -3539,6 +3545,10 @@ loop_iterations (loop)
return 0;
}
+ /* If we have already counted it, skip it. */
+ if (biv_inc->same)
+ continue;
+
offset -= INTVAL (biv_inc->add_val);
}
}
OpenPOWER on IntegriCloud