This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR38729


This fixes PR38729, IV canonicalization taking a long time with
-O1 -fbounds-check due to the large number of loops with multiple
exits (VRP doesn't run to cleanup the bound checks).

Bootstrapped and tested on x86_64-unknown-linux-gnu, Zdenek, is this
ok with you?

Thanks,
Richard.

2009-06-20  Richard Guenther  <rguenther@suse.de>

	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.

Index: gcc/tree-ssa-loop-niter.c
===================================================================
*** gcc/tree-ssa-loop-niter.c	(revision 148746)
--- gcc/tree-ssa-loop-niter.c	(working copy)
*************** find_loop_niter_by_eval (struct loop *lo
*** 2254,2259 ****
--- 2254,2265 ----
    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))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]