aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
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 433900c..ba1854a 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;