[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595 --- Comment #8 from Richard Biener --- Author: rguenth Date: Thu Nov 24 12:25:22 2016 New Revision: 242835 URL: https://gcc.gnu.org/viewcvs?rev=242835=gcc=rev Log: 2016-11-24 Richard BienerPR tree-optimization/71595 * cfgloopmanip.h (remove_path): Add irred_invalidated and loop_closed_ssa_invalidated parameters, defaulted to NULL. * cfgloopmanip.c (remove_path): Likewise, pass them along to called functions. Only fix irred flags if the caller didn't request state. * tree-ssa-loop-ivcanon.c (unloop_loops): Use add_bb_to_loop. (unloop_loops): Pass irred_invalidated and loop_closed_ssa_invalidated to remove_path. * gcc.dg/torture/pr71595.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr71595.c Modified: trunk/gcc/ChangeLog trunk/gcc/cfgloopmanip.c trunk/gcc/cfgloopmanip.h trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-loop-ivcanon.c
[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595 Richard Biener changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #7 from Richard Biener --- Fixed.
[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595 --- Comment #6 from Richard Biener --- diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index beb65b0..4af39fa 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -647,7 +647,7 @@ unloop_loops (bitmap loop_closed_ssa_invalidated, latch_edge->flags |= flags; latch_edge->goto_locus = locus; - latch_edge->dest->loop_father = current_loops->tree_root; + add_bb_to_loop (latch_edge->dest, current_loops->tree_root); latch_edge->dest->count = 0; latch_edge->dest->frequency = 0; set_immediate_dominator (CDI_DOMINATORS, latch_edge->dest, latch_edge->src); fixes that verification issue (but not the loop-closed SSA issue). It looks like remove_path doesn't properly update loop_closed_ssa_invalidated.
[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595 --- Comment #4 from Richard Biener --- The real reason is probably that after if (changed) { unsigned i; unloop_loops (loop_closed_ssa_invalidated, _invalidated); the loop tree is hosed. The following into-loop-closed-SSA rewrite cannot be possibly successful then.
[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595 Richard Biener changed: What|Removed |Added Status|NEW |ASSIGNED Known to work||6.2.1 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #5 from Richard Biener --- Debug patch: diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index beb65b0..6948e62 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -1379,6 +1379,8 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer) unloop_loops (loop_closed_ssa_invalidated, _invalidated); + verify_loop_structure (); + /* We can not use TODO_update_ssa_no_phi because VOPS gets confused. */ if (loop_closed_ssa_invalidated && !bitmap_empty_p (loop_closed_ssa_invalidated)) mine.
[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |7.0
[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org Known to fail||7.0 --- Comment #3 from Martin Sebor --- The ICE was introduced in r236874: r236874 | hubicka | 2016-05-30 06:40:33 -0400 (Mon, 30 May 2016) | 10 lines * predict.h (force_edge_cold): Declare. * predict.c (force_edge_cold): New function. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Fix profile updating. (canonicalize_loop_induction_variables): Fix formating. * gcc.dg/tree-ssa/cunroll-12.c: New testcase. * gcc.dg/tree-ssa/cunroll-13.c: New testcase. * gcc.dg/tree-ssa/cunroll-14.c: New testcase.