Patchwork Fix PR53031

login
register
mail settings
Submitter Richard Guenther
Date April 19, 2012, 12:47 p.m.
Message ID <Pine.LNX.4.64.1204191445420.23071@jbgna.fhfr.qr>
Download mbox | patch
Permalink /patch/153746/
State New
Headers show

Comments

Richard Guenther - April 19, 2012, 12:47 p.m.
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.
H.J. Lu - April 21, 2012, 10:43 p.m.
On Thu, Apr 19, 2012 at 5:47 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> 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.

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53047
H.J. Lu - April 22, 2012, 5:14 p.m.
On Thu, Apr 19, 2012 at 5:47 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> 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.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53073
H.J. Lu - April 22, 2012, 5:18 p.m.
On Sat, Apr 21, 2012 at 3:43 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Apr 19, 2012 at 5:47 AM, Richard Guenther <rguenther@suse.de> wrote:
>>
>> 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.
>
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53047
>

It isn't the cause for PR 53047.  But it does cause another bug.
H.J. Lu - April 22, 2012, 5:22 p.m.
On Sun, Apr 22, 2012 at 10:14 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Apr 19, 2012 at 5:47 AM, Richard Guenther <rguenther@suse.de> wrote:
>>
>> 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.
>>
>
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53073
>

and also

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53046

Patch

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;