From 00631022d83c44777b37f168831eb64142737cbe Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 30 May 2016 23:36:24 +0200 Subject: 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 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-parser.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index f7d1a6d..d2a8947 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2016-05-30 Jakub Jelinek + + PR c++/71349 + * c-parser.c (c_parser_omp_for): Don't disallow nowait clause + when combined with target construct. + 2016-05-26 Jakub Jelinek * c-parser.c (c_parser_omp_clause_schedule): Warn if diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index fda2df8..bca8653 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -15113,7 +15113,9 @@ c_parser_omp_for (location_t loc, c_parser *parser, 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) -- cgit v1.1