aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-21 21:53:16 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-21 21:53:16 +0100
commit3e129b5bc6bc96a0844dcdf75188dc4710028939 (patch)
tree57ddf070a21d3f7a8a1953218bf99368d9a4f3b0 /gcc/tree-cfg.c
parent535808fd722db576f0f14424bc083fbef183fd4b (diff)
downloadgcc-3e129b5bc6bc96a0844dcdf75188dc4710028939.zip
gcc-3e129b5bc6bc96a0844dcdf75188dc4710028939.tar.gz
gcc-3e129b5bc6bc96a0844dcdf75188dc4710028939.tar.bz2
re PR tree-optimization/84960 (ICE in GIMPLE pass: isolate-paths)
PR tree-optimization/84960 * tree-cfg.c (remove_bb): Don't move forced labels into bb->prev_bb if it is ENTRY block, move them into single succ of ENTRY in that case. * gcc.c-torture/compile/pr84960.c: New test. From-SVN: r258744
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index b87e48d..9485f73 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2301,6 +2301,12 @@ remove_bb (basic_block bb)
}
new_bb = bb->prev_bb;
+ /* Don't move any labels into ENTRY block. */
+ if (new_bb == ENTRY_BLOCK_PTR_FOR_FN (cfun))
+ {
+ new_bb = single_succ (new_bb);
+ gcc_assert (new_bb != bb);
+ }
new_gsi = gsi_start_bb (new_bb);
gsi_remove (&i, false);
gsi_insert_before (&new_gsi, stmt, GSI_NEW_STMT);