aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-05-02 12:41:44 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2006-05-02 12:41:44 +0200
commit2aee3e57aed77de4f5ef28a8711b315aeb1bf77c (patch)
tree61b2330a1ce5d4bae00e79479b913e9d6160443f /gcc/omp-low.c
parent4a31b7ee3c5e45b11c283fda801ac4b773ad2a19 (diff)
downloadgcc-2aee3e57aed77de4f5ef28a8711b315aeb1bf77c.zip
gcc-2aee3e57aed77de4f5ef28a8711b315aeb1bf77c.tar.gz
gcc-2aee3e57aed77de4f5ef28a8711b315aeb1bf77c.tar.bz2
re PR middle-end/27328 (ICE with -fopenmp and goto)
PR middle-end/27328 * omp-low.c (remove_exit_barrier): Handle NULL exit_bb. (expand_omp_parallel): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * gcc.dg/gomp/pr27328.c: New test. From-SVN: r113455
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 92d71ae..62b715e 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -2227,6 +2227,11 @@ remove_exit_barrier (struct omp_region *region)
exit_bb = region->exit;
+ /* If the parallel region doesn't return, we don't have REGION->EXIT
+ block at all. */
+ if (! exit_bb)
+ return;
+
/* The last insn in the block will be the parallel's OMP_RETURN. The
workshare's OMP_RETURN will be in a preceding block. The kinds of
statements that can appear in between are extremely limited -- no
@@ -2372,15 +2377,20 @@ expand_omp_parallel (struct omp_region *region)
regions has invalidated it. */
free_dominance_info (CDI_DOMINATORS);
new_bb = move_sese_region_to_fn (child_cfun, entry_bb, exit_bb);
- single_succ_edge (new_bb)->flags = EDGE_FALLTHRU;
+ if (exit_bb)
+ single_succ_edge (new_bb)->flags = EDGE_FALLTHRU;
cgraph_add_new_function (child_fn);
/* Convert OMP_RETURN into a RETURN_EXPR. */
- si = bsi_last (exit_bb);
- gcc_assert (!bsi_end_p (si) && TREE_CODE (bsi_stmt (si)) == OMP_RETURN);
- t = build1 (RETURN_EXPR, void_type_node, NULL);
- bsi_insert_after (&si, t, TSI_SAME_STMT);
- bsi_remove (&si, true);
+ if (exit_bb)
+ {
+ si = bsi_last (exit_bb);
+ gcc_assert (!bsi_end_p (si)
+ && TREE_CODE (bsi_stmt (si)) == OMP_RETURN);
+ t = build1 (RETURN_EXPR, void_type_node, NULL);
+ bsi_insert_after (&si, t, TSI_SAME_STMT);
+ bsi_remove (&si, true);
+ }
}
/* Emit a library call to launch the children threads. */