aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-05-02 12:40:21 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2006-05-02 12:40:21 +0200
commit4a31b7ee3c5e45b11c283fda801ac4b773ad2a19 (patch)
treed598c10da2c86bd4a2443aeb1f20041fa2ef31d4 /gcc/omp-low.c
parentd5d86fde90742a0fcd0a75693ec977b5d8bf5645 (diff)
downloadgcc-4a31b7ee3c5e45b11c283fda801ac4b773ad2a19.zip
gcc-4a31b7ee3c5e45b11c283fda801ac4b773ad2a19.tar.gz
gcc-4a31b7ee3c5e45b11c283fda801ac4b773ad2a19.tar.bz2
re PR middle-end/27325 (ICE with enabled exceptions and -fopenmp)
PR middle-end/27325 * omp-low.c (lower_omp_sections): Call maybe_catch_exception on statement list containing also constructors and destructors. (lower_omp_single, lower_omp_for, lower_omp_parallel): Likewise. * g++.dg/gomp/pr27325.C: New test. From-SVN: r113454
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 9c90b90..92d71ae 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3415,7 +3415,6 @@ lower_omp_sections (tree *stmt_p, omp_context *ctx)
block = make_node (BLOCK);
bind = build3 (BIND_EXPR, void_type_node, NULL, body, block);
- maybe_catch_exception (&BIND_EXPR_BODY (bind));
olist = NULL_TREE;
lower_reduction_clauses (OMP_SECTIONS_CLAUSES (stmt), &olist, ctx);
@@ -3437,6 +3436,8 @@ lower_omp_sections (tree *stmt_p, omp_context *ctx)
append_to_statement_list (olist, &new_body);
append_to_statement_list (dlist, &new_body);
+ maybe_catch_exception (&new_body);
+
t = make_node (OMP_RETURN);
OMP_RETURN_NOWAIT (t) = !!find_omp_clause (OMP_SECTIONS_CLAUSES (stmt),
OMP_CLAUSE_NOWAIT);
@@ -3572,7 +3573,6 @@ lower_omp_single (tree *stmt_p, omp_context *ctx)
lower_rec_input_clauses (OMP_SINGLE_CLAUSES (single_stmt),
&BIND_EXPR_BODY (bind), &dlist, ctx);
lower_omp (&OMP_SINGLE_BODY (single_stmt), ctx);
- maybe_catch_exception (&OMP_SINGLE_BODY (single_stmt));
append_to_statement_list (single_stmt, &BIND_EXPR_BODY (bind));
@@ -3585,6 +3585,8 @@ lower_omp_single (tree *stmt_p, omp_context *ctx)
append_to_statement_list (dlist, &BIND_EXPR_BODY (bind));
+ maybe_catch_exception (&BIND_EXPR_BODY (bind));
+
t = make_node (OMP_RETURN);
OMP_RETURN_NOWAIT (t) = !!find_omp_clause (OMP_SINGLE_CLAUSES (single_stmt),
OMP_CLAUSE_NOWAIT);
@@ -3852,7 +3854,6 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
append_to_statement_list (stmt, body_p);
- maybe_catch_exception (&OMP_FOR_BODY (stmt));
append_to_statement_list (OMP_FOR_BODY (stmt), body_p);
t = make_node (OMP_CONTINUE);
@@ -3863,6 +3864,8 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
lower_reduction_clauses (OMP_FOR_CLAUSES (stmt), body_p, ctx);
append_to_statement_list (dlist, body_p);
+ maybe_catch_exception (body_p);
+
/* Region exit marker goes at the end of the loop body. */
t = make_node (OMP_RETURN);
OMP_RETURN_NOWAIT (t) = fd.have_nowait;
@@ -3900,7 +3903,6 @@ lower_omp_parallel (tree *stmt_p, omp_context *ctx)
par_ilist = NULL_TREE;
lower_rec_input_clauses (clauses, &par_ilist, &par_olist, ctx);
lower_omp (&par_body, ctx);
- maybe_catch_exception (&par_body);
lower_reduction_clauses (clauses, &par_olist, ctx);
/* Declare all the variables created by mapping and the variables
@@ -3936,6 +3938,7 @@ lower_omp_parallel (tree *stmt_p, omp_context *ctx)
append_to_statement_list (par_ilist, &new_body);
append_to_statement_list (par_body, &new_body);
append_to_statement_list (par_olist, &new_body);
+ maybe_catch_exception (&new_body);
t = make_node (OMP_RETURN);
append_to_statement_list (t, &new_body);
OMP_PARALLEL_BODY (stmt) = new_body;