diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-10-29 16:19:24 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-10-29 16:19:24 +0100 |
commit | 4d731f1702c373c4ce2efcd1adb2b4720cc223d5 (patch) | |
tree | b4c49a7a8cdfe8442ec39b009e7cc9cd2ea509f0 /gcc/tree-cfgcleanup.c | |
parent | a848cf52b5e71ebeb05a23888ff3660c4f5012b8 (diff) | |
download | gcc-4d731f1702c373c4ce2efcd1adb2b4720cc223d5.zip gcc-4d731f1702c373c4ce2efcd1adb2b4720cc223d5.tar.gz gcc-4d731f1702c373c4ce2efcd1adb2b4720cc223d5.tar.bz2 |
re PR middle-end/37913 (ICE: Segmentation fault in link_block, cfg.c:153)
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.
From-SVN: r141426
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r-- | gcc/tree-cfgcleanup.c | 5 |
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; |