re PR c/91149 (GCC 9 and later incorrectly rejects OpenMP task reduction-modifier...
authorJakub Jelinek <jakub@redhat.com>
Sat, 13 Jul 2019 06:29:46 +0000 (08:29 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 13 Jul 2019 06:29:46 +0000 (08:29 +0200)
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
gcc/c-family/c-omp.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/gomp/reduction-task-3.c [new file with mode: 0644]

index b84e1f5b9a0da69b7efeb165b675f1708a557000..d360759728eb0b05a6f7972b786478da006c7cf1 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/91149
+       * c-omp.c (c_omp_split_clauses): Fix a pasto in
+       OMP_CLAUSE_REDUCTION_TASK handling.
+
 2019-07-12  Jakub Jelinek  <jakub@redhat.com>
 
        * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ORDER.
index fc08e939651c0d766f50cc9fd0eb7e542b1dc2dc..dc59bd2ceebdc0677de981a2249dc9e3bd4a0742 100644 (file)
@@ -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)
                {
index dccf6ee594aa15fc5582c264a78ddc6137c15a6d..22cd660a2c9b462574b171c471d0cc8a54e97d4b 100644 (file)
@@ -1,5 +1,8 @@
 2019-07-13  Jakub Jelinek  <jakub@redhat.com>
 
+       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 (file)
index 0000000..bde2ccb
--- /dev/null
@@ -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++;
+}