aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-04-07 14:30:53 +0200
committerJakub Jelinek <jakub@redhat.com>2020-04-07 14:30:53 +0200
commit4df50a059fbd4d4a1cb067bd43caccdfca0327a8 (patch)
tree5b56ab4714e7f68a8262ee6a2f5a33b26e9f3282 /gcc/c
parent7a6588fe65432c0f1a8b5fdefba81700ebf88711 (diff)
downloadgcc-4df50a059fbd4d4a1cb067bd43caccdfca0327a8.zip
gcc-4df50a059fbd4d4a1cb067bd43caccdfca0327a8.tar.gz
gcc-4df50a059fbd4d4a1cb067bd43caccdfca0327a8.tar.bz2
openmp: Fix parallel master error recovery [PR94512]
We need to set OMP_PARALLEL_COMBINED only if the parsing of omp_master succeeded, because otherwise there is no nested master construct in the parallel. 2020-04-07 Jakub Jelinek <jakub@redhat.com> PR c++/94512 * c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED if c_parser_omp_master succeeded. * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED if cp_parser_omp_master succeeded. * g++.dg/gomp/pr94512.C: New test.
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-parser.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index a3350c2..d30d2b0 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/94512
+ * c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
+ if c_parser_omp_master succeeded.
+
2020-03-23 Jakub Jelinek <jakub@redhat.com>
PR gcov-profile/94029
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index aeeac8c..17a28e9 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -18877,9 +18877,9 @@ c_parser_omp_parallel (location_t loc, c_parser *parser,
stmt = c_finish_omp_parallel (loc,
cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL],
block);
- OMP_PARALLEL_COMBINED (stmt) = 1;
if (ret == NULL)
return ret;
+ OMP_PARALLEL_COMBINED (stmt) = 1;
return stmt;
}
else if (strcmp (p, "loop") == 0)