aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-split-paths.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2016-02-29 15:45:41 -0700
committerJeff Law <law@gcc.gnu.org>2016-02-29 15:45:41 -0700
commit0c6072a3fc25e656c606247df51a448ab21326c0 (patch)
treeec4fb7504f0481f105f0de78e43f4a26a0986580 /gcc/gimple-ssa-split-paths.c
parent8cfb576a289ce5676d7fa07744aadc0107902718 (diff)
downloadgcc-0c6072a3fc25e656c606247df51a448ab21326c0.zip
gcc-0c6072a3fc25e656c606247df51a448ab21326c0.tar.gz
gcc-0c6072a3fc25e656c606247df51a448ab21326c0.tar.bz2
re PR tree-optimization/69999 (ICE in verify_loop_structure, at cfgloop.c:1639 (error: loop with header 3 not in loop tree) at -O3 or -Ofast)
PR tree-optimization/69999 * gimple-ssa-split-paths.c (split_paths): When duplicating a block with an outgoing edge marked with EDGE_IRREDUCIBLE_LOOP, schedule loop cleanups. PR tree-optimization/69999 * gcc.c-torture/compile/pr69999.c: New test. From-SVN: r233824
Diffstat (limited to 'gcc/gimple-ssa-split-paths.c')
-rw-r--r--gcc/gimple-ssa-split-paths.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/gimple-ssa-split-paths.c b/gcc/gimple-ssa-split-paths.c
index ac6de81..d566f64 100644
--- a/gcc/gimple-ssa-split-paths.c
+++ b/gcc/gimple-ssa-split-paths.c
@@ -294,6 +294,24 @@ split_paths ()
basic_block pred0 = EDGE_PRED (bb, 0)->src;
transform_duplicate (pred0, bb);
changed = true;
+
+ /* If BB has an outgoing edge marked as IRREDUCIBLE, then
+ duplicating BB may result in an irreducible region turning
+ into a natural loop.
+
+ Long term we might want to hook this into the block
+ duplication code, but as we've seen with similar changes
+ for edge removal, that can be somewhat risky. */
+ if (EDGE_SUCC (bb, 0)->flags & EDGE_IRREDUCIBLE_LOOP
+ || EDGE_SUCC (bb, 1)->flags & EDGE_IRREDUCIBLE_LOOP)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ "Join block %d has EDGE_IRREDUCIBLE_LOOP set. "
+ "Scheduling loop fixups.\n",
+ bb->index);
+ loops_state_set (LOOPS_NEED_FIXUP);
+ }
}
}