re PR tree-optimization/40062 (high memory usage and compile time in SCEV cprop with -O3)

2009-05-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/40062
	* tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi):
	Avoid exponential behavior.

From-SVN: r147284
This commit is contained in:
Richard Guenther 2009-05-08 12:28:01 +00:00 committed by Richard Biener
parent c2a9dca345
commit edcbcc61a7
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2009-05-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/40062
* tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi):
Avoid exponential behavior.
2009-05-07 Janis Johnson <janis187@us.ibm.com>
PR middle-end/39986

View File

@ -1320,11 +1320,7 @@ follow_ssa_edge_in_condition_phi (struct loop *loop,
*evolution_of_loop = evolution_of_branch;
/* If the phi node is just a copy, do not increase the limit. */
n = gimple_phi_num_args (condition_phi);
if (n > 1)
limit++;
for (i = 1; i < n; i++)
{
/* Quickly give up when the evolution of one of the branches is
@ -1332,10 +1328,12 @@ follow_ssa_edge_in_condition_phi (struct loop *loop,
if (*evolution_of_loop == chrec_dont_know)
return t_true;
/* Increase the limit by the PHI argument number to avoid exponential
time and memory complexity. */
res = follow_ssa_edge_in_condition_phi_branch (i, loop, condition_phi,
halting_phi,
&evolution_of_branch,
init, limit);
init, limit + i);
if (res == t_false || res == t_dont_know)
return res;