From 2cee15096c4e76bec61b97a5c0e595dfdf9224a4 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sun, 21 Jun 2009 10:22:08 +0000 Subject: re PR middle-end/38729 (long time needed in tree canonical iv) 2009-06-21 Richard Guenther PR tree-optimization/38729 * tree-ssa-loop-niter.c (find_loop_niter_by_eval): Restrict to loops with a single exit if -fno-expensive-optimizations. From-SVN: r148761 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-loop-niter.c | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4478145..55ec1ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-06-21 Richard Guenther + + PR tree-optimization/38729 + * tree-ssa-loop-niter.c (find_loop_niter_by_eval): Restrict + to loops with a single exit if -fno-expensive-optimizations. + 2009-06-21 Jakub Jelinek * var-tracking.c (struct shared_hash_def, shared_hash): New types. diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 18fd6b2..48016c0 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2254,6 +2254,12 @@ find_loop_niter_by_eval (struct loop *loop, edge *exit) tree niter = NULL_TREE, aniter; *exit = NULL; + + /* Loops with multiple exits are expensive to handle and less important. */ + if (!flag_expensive_optimizations + && VEC_length (edge, exits) > 1) + return chrec_dont_know; + for (i = 0; VEC_iterate (edge, exits, i, ex); i++) { if (!just_once_each_iteration_p (loop, ex->src)) -- cgit v1.1