]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c/91401 (schedule + dist_schedule clauses rejected on distribute...
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Oct 2019 11:35:09 +0000 (13:35 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 21 Oct 2019 11:35:09 +0000 (13:35 +0200)
Backported from mainline
2019-08-09  Jakub Jelinek  <jakub@redhat.com>

PR c/91401
* c-parser.c (c_parser_omp_clause_dist_schedule): Fix up typos in the
check_no_duplicate_clause call.  Comment it out, instead emit a
warning for duplicate dist_schedule clauses.

* parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
check_no_duplicate_clause call, instead emit a warning for duplicate
dist_schedule clauses.

* c-c++-common/gomp/pr91401-1.c: New test.
* c-c++-common/gomp/pr91401-2.c: New test.

From-SVN: r277243

gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/gomp/pr91401-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/pr91401-2.c [new file with mode: 0644]

index b98aa517ff23c8f297c1c11db5c6e6c8be344aa9..744ab614ce5b4a347e337de439d6a0e5c6413998 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-21  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2019-08-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/91401
+       * c-parser.c (c_parser_omp_clause_dist_schedule): Fix up typos in the
+       check_no_duplicate_clause call.  Comment it out, instead emit a
+       warning for duplicate dist_schedule clauses.
+
 2019-08-31  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline.
index 3b58dc368deef1550b8fc7d1c439633a83059f55..fe6c82612a2457d16beb6eb693781fc7bf6b8420 100644 (file)
@@ -14707,7 +14707,10 @@ c_parser_omp_clause_dist_schedule (c_parser *parser, tree list)
     c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
                               "expected %<,%> or %<)%>");
 
-  check_no_duplicate_clause (list, OMP_CLAUSE_SCHEDULE, "schedule");
+  /* check_no_duplicate_clause (list, OMP_CLAUSE_DIST_SCHEDULE,
+                               "dist_schedule"); */
+  if (omp_find_clause (list, OMP_CLAUSE_DIST_SCHEDULE))
+    warning_at (loc, 0, "too many %qs clauses", "dist_schedule");
   if (t == error_mark_node)
     return list;
 
index 095d27f68d3ceda5c14ebfd24be44033c736d1a9..f6de950dcb4a221f0aa911e935517415e942abf5 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-21  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2019-08-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/91401
+       * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
+       check_no_duplicate_clause call, instead emit a warning for duplicate
+       dist_schedule clauses.
+
 2019-10-16  Richard Biener  <rguenther@suse.de>
 
        Backport from mainline
index 09251bf21356462c04cb392eccb7c0341dc7606c..c9971921e5d38c9778125c75232aeaac79c6977c 100644 (file)
@@ -34896,8 +34896,10 @@ cp_parser_omp_clause_dist_schedule (cp_parser *parser, tree list,
   else if (!cp_parser_require (parser, CPP_CLOSE_PAREN, RT_COMMA_CLOSE_PAREN))
     goto resync_fail;
 
-  check_no_duplicate_clause (list, OMP_CLAUSE_DIST_SCHEDULE, "dist_schedule",
-                            location);
+  /* check_no_duplicate_clause (list, OMP_CLAUSE_DIST_SCHEDULE,
+                               "dist_schedule", location); */
+  if (omp_find_clause (list, OMP_CLAUSE_DIST_SCHEDULE))
+    warning_at (location, 0, "too many %qs clauses", "dist_schedule");
   OMP_CLAUSE_CHAIN (c) = list;
   return c;
 
index 33dc7d9b844bcd094d7977d71ced3064533cb137..84aaff44669437bcedeccefbbb4494a7ae294805 100644 (file)
@@ -1,3 +1,12 @@
+2019-10-21  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2019-08-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/91401
+       * c-c++-common/gomp/pr91401-1.c: New test.
+       * c-c++-common/gomp/pr91401-2.c: New test.
+
 2019-10-18  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/69455
diff --git a/gcc/testsuite/c-c++-common/gomp/pr91401-1.c b/gcc/testsuite/c-c++-common/gomp/pr91401-1.c
new file mode 100644 (file)
index 0000000..f588bf6
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR c/91401 */
+
+void
+foo (void)
+{
+  int i;
+  #pragma omp distribute parallel for schedule (static) dist_schedule (static)
+  for (i = 0; i < 64; i++)
+    ;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/pr91401-2.c b/gcc/testsuite/c-c++-common/gomp/pr91401-2.c
new file mode 100644 (file)
index 0000000..f537e66
--- /dev/null
@@ -0,0 +1,15 @@
+#pragma omp declare target
+void f0 (void);
+
+void
+f1 (void)
+{
+  int i;
+  #pragma omp distribute dist_schedule(static) dist_schedule(static)   /* { dg-warning "too many 'dist_schedule' clauses" } */
+  for (i = 0; i < 8; ++i)
+    f0 ();
+  #pragma omp distribute dist_schedule(static,2) dist_schedule(static,4) /* { dg-warning "too many 'dist_schedule' clauses" } */
+  for (i = 0; i < 8; ++i)
+    f0 ();
+}
+#pragma omp end declare target