summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivcanon.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-ivcanon.c')
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index df48dfd2bc8..e9841f5006f 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -522,6 +522,7 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
struct loop *loop;
bool changed;
enum unroll_level ul;
+ int iteration = 0;
do
{
@@ -554,7 +555,8 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
scev_reset ();
}
}
- while (changed);
+ while (changed
+ && ++iteration <= PARAM_VALUE (PARAM_MAX_UNROLL_ITERATIONS));
return 0;
}