diff options
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 6225427..f196428 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -7143,11 +7143,14 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb, } /* Examine the statements in BB (which is in SRC_CFUN); find and return - the outermost EH region. Use REGION as the incoming base EH region. */ + the outermost EH region. Use REGION as the incoming base EH region. + If there is no single outermost region, return NULL and set *ALL to + true. */ static eh_region find_outermost_region_in_block (struct function *src_cfun, - basic_block bb, eh_region region) + basic_block bb, eh_region region, + bool *all) { gimple_stmt_iterator si; @@ -7166,7 +7169,11 @@ find_outermost_region_in_block (struct function *src_cfun, else if (stmt_region != region) { region = eh_region_outermost (src_cfun, stmt_region, region); - gcc_assert (region != NULL); + if (region == NULL) + { + *all = true; + return NULL; + } } } } @@ -7501,12 +7508,17 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, if (saved_cfun->eh) { eh_region region = NULL; + bool all = false; FOR_EACH_VEC_ELT (bbs, i, bb) - region = find_outermost_region_in_block (saved_cfun, bb, region); + { + region = find_outermost_region_in_block (saved_cfun, bb, region, &all); + if (all) + break; + } init_eh_for_function (); - if (region != NULL) + if (region != NULL || all) { new_label_map = htab_create (17, tree_map_hash, tree_map_eq, free); eh_map = duplicate_eh_regions (saved_cfun, region, 0, |