aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-05-30 23:36:24 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-05-30 23:36:24 +0200
commit00631022d83c44777b37f168831eb64142737cbe (patch)
treeb2bd7a6c98062669b723c17a2f37e5aaae9ab967 /gcc/cp/parser.c
parentc8743fc5e5d6959e82d0d5d3ef03c36987921423 (diff)
downloadgcc-00631022d83c44777b37f168831eb64142737cbe.zip
gcc-00631022d83c44777b37f168831eb64142737cbe.tar.gz
gcc-00631022d83c44777b37f168831eb64142737cbe.tar.bz2
re PR c++/71349 (Combined async target clause parsing issues)
PR c++/71349 * c-parser.c (c_parser_omp_for): Don't disallow nowait clause when combined with target construct. * parser.c (cp_parser_omp_for): Don't disallow nowait clause when combined with target construct. (cp_parser_omp_parallel): Pass cclauses == NULL as last argument to cp_parser_omp_all_clauses. * c-omp.c (c_omp_split_clauses): Put OMP_CLAUSE_DEPEND to C_OMP_CLAUSE_SPLIT_TARGET. Put OMP_CLAUSE_NOWAIT to C_OMP_CLAUSE_SPLIT_TARGET if combined with target construct, instead of C_OMP_CLAUSE_SPLIT_FOR. * c-c++-common/gomp/clauses-1.c (bar): Add dd argument. Add nowait depend(inout: dd[0]) clauses where permitted. From-SVN: r236900
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index c6c2c0c..29a1b80 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -33919,7 +33919,9 @@ cp_parser_omp_for (cp_parser *parser, cp_token *pragma_tok,
strcat (p_name, " for");
mask |= OMP_FOR_CLAUSE_MASK;
- if (cclauses)
+ /* parallel for{, simd} disallows nowait clause, but for
+ target {teams distribute ,}parallel for{, simd} it should be accepted. */
+ if (cclauses && (mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) == 0)
mask &= ~(OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOWAIT);
/* Composite distribute parallel for{, simd} disallows ordered clause. */
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) != 0)
@@ -34258,7 +34260,8 @@ cp_parser_omp_parallel (cp_parser *parser, cp_token *pragma_tok,
}
}
- clauses = cp_parser_omp_all_clauses (parser, mask, p_name, pragma_tok);
+ clauses = cp_parser_omp_all_clauses (parser, mask, p_name, pragma_tok,
+ cclauses == NULL);
if (cclauses)
{
cp_omp_split_clauses (loc, OMP_PARALLEL, mask, clauses, cclauses);