summaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-29 15:19:24 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-29 15:19:24 +0000
commit7c70778502ad036b41599db74fc80937e62a1297 (patch)
treeb4c49a7a8cdfe8442ec39b009e7cc9cd2ea509f0 /gcc/tree-cfgcleanup.c
parent4cf41453521357f31c687dbc62025aa483099191 (diff)
downloadgcc-7c70778502ad036b41599db74fc80937e62a1297.tar.gz
PR middle-end/37913
* tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Only split bbs that haven't been removed yet. * gcc.c-torture/compile/pr37913.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141426 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 433900c3a14..ba1854aae0f 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -483,7 +483,12 @@ split_bbs_on_noreturn_calls (void)
{
stmt = VEC_pop (gimple, MODIFIED_NORETURN_CALLS (cfun));
bb = gimple_bb (stmt);
+ /* BB might be deleted at this point, so verify first
+ BB is present in the cfg. */
if (bb == NULL
+ || bb->index < NUM_FIXED_BLOCKS
+ || bb->index >= n_basic_blocks
+ || BASIC_BLOCK (bb->index) != bb
|| last_stmt (bb) == stmt
|| !gimple_call_noreturn_p (stmt))
continue;