From 1a888209de88d4a4a1f415beb28e5a94b95e088f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 13 Jul 2019 08:29:46 +0200 Subject: [PATCH] re PR c/91149 (GCC 9 and later incorrectly rejects OpenMP task reduction-modifier on target parallel combined construct) PR c/91149 * c-omp.c (c_omp_split_clauses): Fix a pasto in OMP_CLAUSE_REDUCTION_TASK handling. * c-c++-common/gomp/reduction-task-3.c: New test. From-SVN: r273465 --- gcc/c-family/ChangeLog | 6 ++++++ gcc/c-family/c-omp.c | 2 +- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/c-c++-common/gomp/reduction-task-3.c | 12 ++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/c-c++-common/gomp/reduction-task-3.c diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index b84e1f5b9a0..d360759728e 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2019-07-13 Jakub Jelinek + + PR c/91149 + * c-omp.c (c_omp_split_clauses): Fix a pasto in + OMP_CLAUSE_REDUCTION_TASK handling. + 2019-07-12 Jakub Jelinek * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ORDER. diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c index fc08e939651..dc59bd2ceeb 100644 --- a/gcc/c-family/c-omp.c +++ b/gcc/c-family/c-omp.c @@ -1667,7 +1667,7 @@ c_omp_split_clauses (location_t loc, enum tree_code code, } else if (code != OMP_SECTIONS && (mask & (OMP_CLAUSE_MASK_1 - << PRAGMA_OMP_CLAUSE_SCHEDULE)) == 0 + << PRAGMA_OMP_CLAUSE_NUM_THREADS)) == 0 && (mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) == 0) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dccf6ee594a..22cd660a2c9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-07-13 Jakub Jelinek + PR c/91149 + * c-c++-common/gomp/reduction-task-3.c: New test. + * c-c++-common/gomp/order-3.c: New test. * c-c++-common/gomp/order-4.c: New test. diff --git a/gcc/testsuite/c-c++-common/gomp/reduction-task-3.c b/gcc/testsuite/c-c++-common/gomp/reduction-task-3.c new file mode 100644 index 00000000000..bde2ccb8791 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/reduction-task-3.c @@ -0,0 +1,12 @@ +/* PR c/91149 */ + +int r; + +void +foo (void) +{ + #pragma omp parallel reduction(task, +: r) + r++; + #pragma omp target parallel reduction(task, +: r) + r++; +} -- 2.30.2