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

2010-02-27  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: Adjust testcase.

From-SVN: r157114
This commit is contained in:
Richard Guenther 2010-02-27 23:28:46 +00:00 committed by Richard Biener
parent 812be315ca
commit 30bc1dca9c
6 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2010-02-27 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-02-27 H.J. Lu <hongjiu.lu@intel.com>
* config.gcc: Set the default 32bit/64bit archs if 64bit ISA is

View File

@ -8094,6 +8094,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

@ -266,6 +266,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-02-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43186
* gcc.c-torture/compile/pr43186.c: Adjust testcase.
2010-02-27 Kaz Kojima <kkojima@gcc.gnu.org>
* g++.dg/abi/packed1.C: Expect warning on the SH.

View File

@ -5,7 +5,7 @@ void foo (int i)
int a, b;
if (!i)
for (a = 1; a < 3; a++)
for (a = 1; a < 4; a++)
if (a)
for (b = 1; b < 3; b++)
foo (b);

View File

@ -522,6 +522,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
{
@ -554,7 +555,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;
}