Commit 7bec30e1 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/48228 (incorrect signed overflow warning when only 0 and 1 are used)

2011-03-22  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/48228
	* tree-vrp.c (vrp_visit_phi_node): Do not stop propagating
	for single-arg PHIs.

	* gcc.dg/Wstrict-overflow-23.c: New testcase.

From-SVN: r171287
parent 0b7e851b
2011-03-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/48228
* tree-vrp.c (vrp_visit_phi_node): Do not stop propagating
for single-arg PHIs.
2011-03-22 Andrey Belevantsev <abel@ispras.ru> 2011-03-22 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/48143 PR rtl-optimization/48143
......
2011-03-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/48228
* gcc.dg/Wstrict-overflow-23.c: New testcase.
2011-03-21 Jack Howarth <howarth@bromo.med.uc.edu> 2011-03-21 Jack Howarth <howarth@bromo.med.uc.edu>
* lib/prune.exp (prune_gcc_output): Prune "could not create * lib/prune.exp (prune_gcc_output): Prune "could not create
......
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-overflow" } */
unsigned int
do_scrolling (unsigned int window_size, unsigned int writecost)
{
unsigned int i = window_size;
int terminal_window_p = 0;
unsigned int queue = 0;
for (i = window_size; i; i--)
{
if (writecost < i)
++queue;
else if (writecost & 1)
terminal_window_p = 1;
}
if (queue > 0)
{
if (!terminal_window_p)
{
terminal_window_p = 1;
}
}
if (terminal_window_p)
return 100;
return 0;
}
...@@ -6619,6 +6619,7 @@ vrp_visit_phi_node (gimple phi) ...@@ -6619,6 +6619,7 @@ vrp_visit_phi_node (gimple phi)
edge; this helps us avoid an overflow infinity for conditionals edge; this helps us avoid an overflow infinity for conditionals
which are not in a loop. */ which are not in a loop. */
if (edges > 0 if (edges > 0
&& gimple_phi_num_args (phi) > 1
&& edges == old_edges) && edges == old_edges)
{ {
int cmp_min = compare_values (lhs_vr->min, vr_result.min); int cmp_min = compare_values (lhs_vr->min, vr_result.min);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment