aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-02-27 23:28:46 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-02-27 23:28:46 +0000
commit30bc1dca9c5a4af7b631bda879a200853a54dcfa (patch)
tree0216165e214b4aecd783ed93348bd6396edb33ee /gcc
parent812be315ca9acfb503d125bd16be043849be2c77 (diff)
downloadgcc-30bc1dca9c5a4af7b631bda879a200853a54dcfa.zip
gcc-30bc1dca9c5a4af7b631bda879a200853a54dcfa.tar.gz
gcc-30bc1dca9c5a4af7b631bda879a200853a54dcfa.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/doc/invoke.texi3
-rw-r--r--gcc/params.def5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr43186.c2
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c4
6 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f6cdb86..049729b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 6a6bd92..36580fb 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -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.
diff --git a/gcc/params.def b/gcc/params.def
index 21dcb44..07bfb90 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -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,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8884795..bf0b7ce8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43186.c b/gcc/testsuite/gcc.c-torture/compile/pr43186.c
index d235e97..7171e6a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr43186.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr43186.c
@@ -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);
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index df48dfd..e9841f5 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -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;
}