This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR53031
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Apr 2012 14:47:31 +0200 (CEST)
- Subject: [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;