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 PR53031


This fixes PR53031 and reverts back to using the number of latch
iterations in VRP when computing ranges for induction variables.
Now after ira_allocno_object_iter_cond is fixed this no longer
breaks bootstrap.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2012-04-19  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/53031
	* tree-vrp.c (adjust_range_with_scev): Revert back to
	using max_loop_iterations.

Index: gcc/tree-vrp.c
===================================================================
--- gcc/tree-vrp.c	(revision 186589)
+++ gcc/tree-vrp.c	(working copy)
@@ -3420,7 +3420,9 @@ adjust_range_with_scev (value_range_t *v
     {
       double_int nit;
 
-      if (max_stmt_executions (loop, &nit))
+      /* We are only entering here for loop header PHI nodes, so using
+	 the number of latch executions is the correct thing to use.  */
+      if (max_loop_iterations (loop, &nit))
 	{
 	  value_range_t maxvr = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
 	  double_int dtmp;


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