]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c/91149 (GCC 9 and later incorrectly rejects OpenMP task reduction...
authorJakub Jelinek <jakub@redhat.com>
Sun, 14 Jul 2019 08:29:38 +0000 (10:29 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 14 Jul 2019 08:29:38 +0000 (10:29 +0200)
Backported from mainline
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.

* c-c++-common/gomp/reduction-task-3.c: New test.

From-SVN: r273478

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 1220c634c848d33ef36301c7c6744580a81fa2b0..918141c33ac4ea581a6cd6e349b1794e310557b1 100644 (file)
@@ -1,3 +1,12 @@
+2019-07-14  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       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-06-29  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index 88418f66553250a27b31d60aaea6e35f2792e42d..1f288a6fbb21f4bc8c56e7eb622e02e9dbf46077 100644 (file)
@@ -1648,7 +1648,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 994f11010ac0b3a28606e706371a74702ba45aa9..0146529ed43ad81f61a562b9de774406df71fb0b 100644 (file)
@@ -1,6 +1,11 @@
 2019-07-14  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-07-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/91149
+       * c-c++-common/gomp/reduction-task-3.c: New test.
+
        2019-07-04  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/78884
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++;
+}