diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-02 10:41:44 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-02 10:41:44 +0000 |
commit | 5056ba1a33d3f4891671b26c02048d5f7fbeca9f (patch) | |
tree | 61b2330a1ce5d4bae00e79479b913e9d6160443f /gcc/omp-low.c | |
parent | aade31a0ad15d489c644dbcf02c3681a4372bd4b (diff) | |
download | gcc-5056ba1a33d3f4891671b26c02048d5f7fbeca9f.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113455 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 92d71ae025c..62b715e37ad 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. */ |