diff options
Diffstat (limited to 'gcc/tree-ssa-loop-ch.c')
-rw-r--r-- | gcc/tree-ssa-loop-ch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index df45c286790..2e80649fe2d 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -243,6 +243,16 @@ copy_loop_headers (void) are not now, since there was the loop exit condition. */ split_edge (loop_preheader_edge (loop)); split_edge (loop_latch_edge (loop)); + + /* We peeled off one iteration of the loop thus we can lower + the maximum number of iterations if we have a previously + recorded value for that. */ + widest_int max; + if (get_max_loop_iterations (loop, &max)) + { + max -= 1; + loop->nb_iterations_upper_bound = max; + } } update_ssa (TODO_update_ssa); |