]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
authorcltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Feb 2019 14:10:15 +0000 (14:10 +0000)
committercltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Feb 2019 14:10:15 +0000 (14:10 +0000)
PR c/87924
gcc/c/
* c-parser.c (c_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.

gcc/cp/
* parser.c (cp_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.

gcc/fortran/
* openmp.c (gfc_match_omp_clauses): Add representation of wait clause
without argument as 'wait (GOMP_ASYNC_NOVAL)'.

libgomp/
* oacc-parallel.c (GOACC_parallel_keyed): Remove condition on call to
goacc_wait().
(goacc_wait): Handle ACC_ASYNC_NOVAL case, remove goacc_thread() call
and related adjustment.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269016 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/fortran/ChangeLog
gcc/fortran/openmp.c
libgomp/ChangeLog
libgomp/oacc-parallel.c

index 1def92af99a0937718fe79251256002932f9de8d..b76f5b1fae694c3174d532c5a2b6b61b13ce778f 100644 (file)
@@ -1,3 +1,9 @@
+2019-02-19  Chung-Lin Tang <cltang@codesourcery.com>
+
+       PR c/87924
+       * c-parser.c (c_parser_oacc_clause_wait): Add representation of wait
+       clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
+
 2019-02-15  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/89340
index cacbf0ac49564e0186a4acf79e5e753d21e2c369..6c1f3076241fe67398fa145a5b2b930a7b26fd0d 100644 (file)
@@ -13412,7 +13412,7 @@ c_parser_oacc_clause_tile (c_parser *parser, tree list)
 }
 
 /* OpenACC:
-   wait ( int-expr-list ) */
+   wait [( int-expr-list )] */
 
 static tree
 c_parser_oacc_clause_wait (c_parser *parser, tree list)
@@ -13421,6 +13421,14 @@ c_parser_oacc_clause_wait (c_parser *parser, tree list)
 
   if (c_parser_peek_token (parser)->type == CPP_OPEN_PAREN)
     list = c_parser_oacc_wait_list (parser, clause_loc, list);
+  else
+    {
+      tree c = build_omp_clause (clause_loc, OMP_CLAUSE_WAIT);
+
+      OMP_CLAUSE_DECL (c) = build_int_cst (integer_type_node, GOMP_ASYNC_NOVAL);
+      OMP_CLAUSE_CHAIN (c) = list;
+      list = c;
+    }
 
   return list;
 }
index 2373c98b618083264d7d3fa8167697b9592f0ce7..9c42190f04a8c96e07682558d8e497c482e81cc7 100644 (file)
@@ -1,3 +1,9 @@
+2019-02-19  Chung-Lin Tang <cltang@codesourcery.com>
+
+       PR c/87924
+       * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
+       clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
+
 2019-02-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/89387
index adb5f6f27a189585d1af9a197452da0a29a250fe..f8d44e06ec351247f3b487cda08b1ec6a04f1885 100644 (file)
@@ -32867,17 +32867,23 @@ cp_parser_oacc_wait_list (cp_parser *parser, location_t clause_loc, tree list)
 }
 
 /* OpenACC:
-   wait ( int-expr-list ) */
+   wait [( int-expr-list )] */
 
 static tree
 cp_parser_oacc_clause_wait (cp_parser *parser, tree list)
 {
   location_t location = cp_lexer_peek_token (parser->lexer)->location;
 
-  if (cp_lexer_peek_token (parser->lexer)->type != CPP_OPEN_PAREN)
-    return list;
+  if (cp_lexer_peek_token (parser->lexer)->type == CPP_OPEN_PAREN)
+    list = cp_parser_oacc_wait_list (parser, location, list);
+  else
+    {
+      tree c = build_omp_clause (location, OMP_CLAUSE_WAIT);
 
-  list = cp_parser_oacc_wait_list (parser, location, list);
+      OMP_CLAUSE_DECL (c) = build_int_cst (integer_type_node, GOMP_ASYNC_NOVAL);
+      OMP_CLAUSE_CHAIN (c) = list;
+      list = c;
+    }
 
   return list;
 }
index 43eda8c56d754aadc88145395333a6bb7662a4ef..989bf9aba74c8553cb05b4a0d97dd00b76cf07c1 100644 (file)
@@ -1,3 +1,9 @@
+2019-02-19  Chung-Lin Tang  <cltang@codesourcery.com>
+
+       PR c/87924
+       * openmp.c (gfc_match_omp_clauses): Add representation of wait clause
+       without argument as 'wait (GOMP_ASYNC_NOVAL)'.
+
 2019-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/87689
index 8651afaee4f90963c711e522d73267bd997de4a2..11dd3ae0ada5a917223f23988ee51e6b935e54b8 100644 (file)
@@ -1885,7 +1885,19 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
                  break;
                }
              else if (m == MATCH_NO)
-               needs_space = true;
+               {
+                 gfc_expr *expr
+                   = gfc_get_constant_expr (BT_INTEGER,
+                                            gfc_default_integer_kind,
+                                            &gfc_current_locus);
+                 mpz_set_si (expr->value.integer, GOMP_ASYNC_NOVAL);
+                 gfc_expr_list **expr_list = &c->wait_list;
+                 while (*expr_list)
+                   expr_list = &(*expr_list)->next;
+                 *expr_list = gfc_get_expr_list ();
+                 (*expr_list)->expr = expr;
+                 needs_space = true;
+               }
              continue;
            }
          if ((mask & OMP_CLAUSE_WORKER)
index 4d1eca4d75db4dca701329b8f06d22dbfbb6b643..f310c2f6c2490a595b0113bd533ebe7797fd13b8 100644 (file)
@@ -1,3 +1,11 @@
+2019-02-19  Chung-Lin Tang <cltang@codesourcery.com>
+
+       PR c/87924
+       * oacc-parallel.c (GOACC_parallel_keyed): Remove condition on call to
+       goacc_wait().
+       (goacc_wait): Handle ACC_ASYNC_NOVAL case, remove goacc_thread() call
+       and related adjustment.
+
 2019-01-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/88988
index d8a08e974a23ae0df852ef7efea4f0c65f8ab371..b77c5e8b9c5d8da5fe1334a423818752b1db80db 100644 (file)
@@ -206,9 +206,7 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *),
        case GOMP_LAUNCH_WAIT:
          {
            unsigned num_waits = GOMP_LAUNCH_OP (tag);
-
-           if (num_waits)
-             goacc_wait (async, num_waits, &ap);
+           goacc_wait (async, num_waits, &ap);
            break;
          }
 
@@ -514,13 +512,20 @@ GOACC_enter_exit_data (int flags_m, size_t mapnum,
 static void
 goacc_wait (int async, int num_waits, va_list *ap)
 {
-  struct goacc_thread *thr = goacc_thread ();
-  struct gomp_device_descr *acc_dev = thr->dev;
-
   while (num_waits--)
     {
       int qid = va_arg (*ap, int);
-      
+
+      /* Waiting on ACC_ASYNC_NOVAL maps to 'wait all'.  */
+      if (qid == acc_async_noval)
+       {
+         if (async == acc_async_sync)
+           acc_wait_all ();
+         else
+           acc_wait_all_async (async);
+         break;
+       }
+
       if (acc_async_test (qid))
        continue;
 
@@ -531,7 +536,7 @@ goacc_wait (int async, int num_waits, va_list *ap)
            launching on, the queue itself will order work as
            required, so there's no need to wait explicitly.  */
       else
-       acc_dev->openacc.async_wait_async_func (qid, async);
+       acc_wait_async (qid, async);
     }
 }