aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-02-01 09:43:02 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-02-01 09:43:02 +0100
commitac33bce89cdab0c0c43edec60b98a1fccdf3bd4b (patch)
tree9b6949a0d1d15eba96227cb7488b39ba41992694 /gcc/tree-cfg.c
parent7beb51f914e5f5930c279aab88597a39597064a6 (diff)
downloadgcc-ac33bce89cdab0c0c43edec60b98a1fccdf3bd4b.zip
gcc-ac33bce89cdab0c0c43edec60b98a1fccdf3bd4b.tar.gz
gcc-ac33bce89cdab0c0c43edec60b98a1fccdf3bd4b.tar.bz2
re PR tree-optimization/88107 (ICE in find_outermost_region_in_block, at tree-cfg.c:7157)
PR tree-optimization/88107 * tree-cfg.c (find_outermost_region_in_block): Add ALL argument, instead of assertion that eh_region_outermost is non-NULL, if it is NULL, set *ALL to true and return NULL. (move_sese_region_to_fn): Adjust caller, if all is set, call duplicate_eh_regions with NULL region. * gcc.dg/gomp/pr88107.c: New test. From-SVN: r268444
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c22
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,