re PR c/91401 (schedule + dist_schedule clauses rejected on distribute parallel for)
authorJakub Jelinek <jakub@redhat.com>
Fri, 9 Aug 2019 07:23:03 +0000 (09:23 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 9 Aug 2019 07:23:03 +0000 (09:23 +0200)
PR c/91401
c/
* 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.
cp/
* 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.
testsuite/
* c-c++-common/gomp/pr91401-1.c: New test.
* c-c++-common/gomp/pr91401-2.c: New test.

From-SVN: r274226

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 533aebc40c3d677bfac2ae2dc06eef183677cc38..5363f1c85109408a09093d9cfc91d54957b1ca4e 100644 (file)
@@ -1,3 +1,10 @@
+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-08  Richard Sandiford  <richard.sandiford@arm.com>
 
        * c-decl.c (finish_enum): Clear C_TYPE_BEING_DEFINED.
index 9b5cfcf50d949d1ecfb62db4076a43053ddb82e8..9585ba2ca67aa1ada22f5be814a5c27de36f2cb3 100644 (file)
@@ -14811,7 +14811,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 5b0bf2b62b8cd8c13f56b99e2a8bc793bc17c318..93b6e5ac27bbe42d00b45433d7d817ed276258bd 100644 (file)
@@ -1,3 +1,10 @@
+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-08-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
index 14b724095c4d6c3949b4be6018293fd2dfb714af..a2efb551617d2d47c97ba470fc58fec5f8e1fcce 100644 (file)
@@ -35258,8 +35258,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 639e426d10fb76dd33286dd5f583defe712ad3a8..f67c310162870246d9e8ca3c64df7108f271e1cc 100644 (file)
@@ -1,3 +1,9 @@
+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-08-09  Alexandre Oliva <oliva@adacore.com>
 
        * gcc.target/i386/sse2-mul-1.c: Use rand.  Drop fallback.
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