diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-01-30 16:58:22 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-01-30 16:58:22 +0100 |
commit | a59b07c1e17769b9b0cd126731a6466edbfe8801 (patch) | |
tree | b4c5d497b845046df4408d08e8f0aa3e99dbada9 /gcc/tree-ssa-loop-ivcanon.c | |
parent | 9efd61f83b1bf59a4a20fe8d116ddd6bc402dd07 (diff) | |
download | gcc-a59b07c1e17769b9b0cd126731a6466edbfe8801.zip gcc-a59b07c1e17769b9b0cd126731a6466edbfe8801.tar.gz gcc-a59b07c1e17769b9b0cd126731a6466edbfe8801.tar.bz2 |
re PR tree-optimization/84111 (Compile time hog w/ -O2)
PR tree-optimization/84111
* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Skip
inner loops added during recursion, as they don't have up-to-date
SSA form.
* gcc.c-torture/compile/pr84111.c: New test.
From-SVN: r257188
Diffstat (limited to 'gcc/tree-ssa-loop-ivcanon.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivcanon.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index a87ed0b..24bf60e 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -1373,13 +1373,17 @@ tree_unroll_loops_completely_1 (bool may_increase_size, bool unroll_outer, bool changed = false; struct loop *inner; enum unroll_level ul; + unsigned num = number_of_loops (cfun); - /* Process inner loops first. */ + /* Process inner loops first. Don't walk loops added by the recursive + calls because SSA form is not up-to-date. They can be handled in the + next iteration. */ for (inner = loop->inner; inner != NULL; inner = inner->next) - changed |= tree_unroll_loops_completely_1 (may_increase_size, - unroll_outer, father_bbs, - inner); - + if ((unsigned) inner->num < num) + changed |= tree_unroll_loops_completely_1 (may_increase_size, + unroll_outer, father_bbs, + inner); + /* If we changed an inner loop we cannot process outer loops in this iteration because SSA form is not up-to-date. Continue with siblings of outer loops instead. */ |