re PR tree-optimization/57685 (GCC stuck in an infinite loop)

2013-08-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/57685
	* tree-vrp.c (register_edge_assert_for_1): Recurse only for
	single-use operands to avoid exponential complexity.

	* gcc.dg/torture/pr57685.c: New testcase.

From-SVN: r202068
This commit is contained in:
Richard Biener 2013-08-29 07:45:59 +00:00 committed by Richard Biener
parent 2ec974d90f
commit 6b1184bab6
4 changed files with 34 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2013-08-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/57685
* tree-vrp.c (register_edge_assert_for_1): Recurse only for
single-use operands to avoid exponential complexity.
2013-08-28 Dehao Chen <dehao@google.com>
* ipa-inline.c (edge_badness): Fix integer underflow.

View File

@ -1,3 +1,8 @@
2013-08-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/57685
* gcc.dg/torture/pr57685.c: New testcase.
2013-08-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58255

View File

@ -0,0 +1,15 @@
/* { dg-do compile } */
unsigned f(void)
{
unsigned a;
int b, c, d, e;
for(c = 27; c < 40; c++)
b |= d |= b;
if(b)
a = e;
return a;
}

View File

@ -5410,10 +5410,14 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
&& gimple_assign_rhs_code (op_def) == BIT_IOR_EXPR))
{
/* Recurse on each operand. */
retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
code, e, bsi);
retval |= register_edge_assert_for_1 (gimple_assign_rhs2 (op_def),
code, e, bsi);
tree op0 = gimple_assign_rhs1 (op_def);
tree op1 = gimple_assign_rhs2 (op_def);
if (TREE_CODE (op0) == SSA_NAME
&& has_single_use (op0))
retval |= register_edge_assert_for_1 (op0, code, e, bsi);
if (TREE_CODE (op1) == SSA_NAME
&& has_single_use (op1))
retval |= register_edge_assert_for_1 (op1, code, e, bsi);
}
else if (gimple_assign_rhs_code (op_def) == BIT_NOT_EXPR
&& TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (op_def))) == 1)