re PR tree-optimization/43186 (A loop in tree_unroll_loops_completely never ends)

2010-04-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43186
	* params.def (PARAM_MAX_UNROLL_ITERATIONS): New param.
	* doc/invoke.texi (max-completely-peel-loop-nest-depth): Document.
	* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Limit
	unroller iterations.

	* gcc.c-torture/compile/pr43186.c: New testcase.

From-SVN: r158114
This commit is contained in:
Richard Guenther 2010-04-08 10:46:46 +00:00 committed by Richard Biener
parent e76f9bce0a
commit d0e0f7f7bd
6 changed files with 39 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2010-04-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43186
* params.def (PARAM_MAX_UNROLL_ITERATIONS): New param.
* doc/invoke.texi (max-completely-peel-loop-nest-depth): Document.
* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Limit
unroller iterations.
2010-04-07 H.J. Lu <hongjiu.lu@intel.com>
PR target/43668

View File

@ -7417,6 +7417,9 @@ The maximum number of insns of a completely peeled loop.
@item max-completely-peel-times
The maximum number of iterations of a loop to be suitable for complete peeling.
@item max-completely-peel-loop-nest-depth
The maximum depth of a loop nest suitable for complete peeling.
@item max-unswitch-insns
The maximum number of insns of an unswitched loop.

View File

@ -292,6 +292,11 @@ DEFPARAM(PARAM_MAX_ONCE_PEELED_INSNS,
"max-once-peeled-insns",
"The maximum number of insns of a peeled loop that rolls only once",
400, 0, 0)
/* The maximum depth of a loop nest we completely peel. */
DEFPARAM(PARAM_MAX_UNROLL_ITERATIONS,
"max-completely-peel-loop-nest-depth",
"The maximum depth of a loop nest we completely peel",
8, 0, 0)
/* The maximum number of insns of an unswitched loop. */
DEFPARAM(PARAM_MAX_UNSWITCH_INSNS,

View File

@ -1,3 +1,8 @@
2010-04-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43186
* gcc.c-torture/compile/pr43186.c: New testcase.
2010-04-07 H.J. Lu <hongjiu.lu@intel.com>
PR target/43668

View File

@ -0,0 +1,15 @@
int n;
void foo (int i)
{
int a, b;
if (!i)
for (a = 1; a < 4; a++)
if (a)
for (b = 1; b < 3; b++)
foo (b);
n++;
}

View File

@ -352,6 +352,7 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
struct loop *loop;
bool changed;
enum unroll_level ul;
int iteration = 0;
do
{
@ -384,7 +385,8 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
scev_reset ();
}
}
while (changed);
while (changed
&& ++iteration <= PARAM_VALUE (PARAM_MAX_UNROLL_ITERATIONS));
return 0;
}