From: Richard Guenther Date: Fri, 8 May 2009 14:14:25 +0000 (+0000) Subject: re PR tree-optimization/40062 (high memory usage and compile time in SCEV cprop with... X-Git-Tag: releases/gcc-4.3.4~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8493e9ace77e968a1cab24eaaf0f29997300ced4;p=thirdparty%2Fgcc.git re PR tree-optimization/40062 (high memory usage and compile time in SCEV cprop with -O3) 2009-05-08 Richard Guenther PR tree-optimization/40062 * tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi): Avoid exponential behavior. From-SVN: r147288 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cebf9da2cacb..f6e9f9cca66e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-05-08 Richard Guenther + + PR tree-optimization/40062 + * tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi): + Avoid exponential behavior. + 2009-05-07 Janis Johnson PR middle-end/39986 diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 2d30410cf308..83728fce324a 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -1272,10 +1272,6 @@ 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. */ - if (PHI_NUM_ARGS (condition_phi) > 1) - limit++; - for (i = 1; i < PHI_NUM_ARGS (condition_phi); i++) { /* Quickly give up when the evolution of one of the branches is @@ -1283,10 +1279,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;