Merge OMP_CLAUSE_USE_DEVICE into OMP_CLAUSE_USE_DEVICE_PTR
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 23 Dec 2015 11:01:18 +0000 (12:01 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Wed, 23 Dec 2015 11:01:18 +0000 (12:01 +0100)
gcc/c/
* c-parser.c (c_parser_oacc_clause_use_device): Merge function
into...
(c_parser_omp_clause_use_device_ptr): ... this function.  Adjust
all users.
gcc/
* tree-core.h (enum omp_clause_code): Merge OMP_CLAUSE_USE_DEVICE
into OMP_CLAUSE_USE_DEVICE_PTR.  Adjust all users.

From-SVN: r231926

15 files changed:
gcc/ChangeLog
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/c/c-typeck.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/fortran/trans-openmp.c
gcc/gimplify.c
gcc/omp-low.c
gcc/testsuite/gfortran.dg/goacc/host_data-tree.f95
gcc/tree-core.h
gcc/tree-nested.c
gcc/tree-pretty-print.c
gcc/tree.c

index aa28d106374fd58ce648b55f3a72eeaefcc5359f..d67b9c6e399dc6a1063a545bb53905ca107c099c 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * tree-core.h (enum omp_clause_code): Merge OMP_CLAUSE_USE_DEVICE
+       into OMP_CLAUSE_USE_DEVICE_PTR.  Adjust all users.
+
 2015-12-23  David Sherwood  <david.sherwood@arm.com>
 
        * config/arm/iterators.md (VMAXMINFNM): New int iterator.
index f99f426d54295104c90b981208140337107d3b3f..7b275d80ac489fb2b3202aa5c97d32ab95e19a26 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * c-parser.c (c_parser_oacc_clause_use_device): Merge function
+       into...
+       (c_parser_omp_clause_use_device_ptr): ... this function.  Adjust
+       all users.
+
 2015-12-22  Marek Polacek  <polacek@redhat.com>
 
        PR c/69002
index 353e3da5377b18dba21da0615717027b3a4d2364..8e754d0800e135fd511378b1b090976631279363 100644 (file)
@@ -11395,7 +11395,10 @@ c_parser_omp_clause_defaultmap (c_parser *parser, tree list)
   return list;
 }
 
-/* OpenMP 4.5:
+/* OpenACC 2.0:
+   use_device ( variable-list )
+
+   OpenMP 4.5:
    use_device_ptr ( variable-list ) */
 
 static tree
@@ -11730,15 +11733,6 @@ c_parser_oacc_clause_tile (c_parser *parser, tree list)
   return c;
 }
 
-/* OpenACC 2.0:
-   use_device ( variable-list ) */
-
-static tree
-c_parser_oacc_clause_use_device (c_parser *parser, tree list)
-{
-  return c_parser_omp_var_list_parens (parser, OMP_CLAUSE_USE_DEVICE, list);
-}
-
 /* OpenACC:
    wait ( int-expr-list ) */
 
@@ -13058,7 +13052,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
          c_name = "tile";
          break;
        case PRAGMA_OACC_CLAUSE_USE_DEVICE:
-         clauses = c_parser_oacc_clause_use_device (parser, clauses);
+         clauses = c_parser_omp_clause_use_device_ptr (parser, clauses);
          c_name = "use_device";
          break;
        case PRAGMA_OACC_CLAUSE_VECTOR:
index 928fcd504d097906b452168b1ab4da1a5bfe14f2..7406bd41862bee837095b6575a1aae223e44e59f 100644 (file)
@@ -13125,7 +13125,6 @@ c_finish_omp_clauses (tree clauses, bool is_omp, bool declare_simd)
          bitmap_set_bit (&map_head, DECL_UID (t));
          goto check_dup_generic;
 
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_IS_DEVICE_PTR:
        case OMP_CLAUSE_USE_DEVICE_PTR:
          t = OMP_CLAUSE_DECL (c);
index 842dded1fcab6c305433b1a972a239ce34c3bcec..4829a776afb89e1331c6b9b0dec0e23f8a4d777e 100644 (file)
@@ -32097,7 +32097,7 @@ cp_parser_oacc_all_clauses (cp_parser *parser, omp_clause_mask mask,
          c_name = "tile";
          break;
        case PRAGMA_OACC_CLAUSE_USE_DEVICE:
-         clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_USE_DEVICE,
+         clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_USE_DEVICE_PTR,
                                            clauses);
          c_name = "use_device";
          break;
index dab15bdad17b21fff75c72bb45128a9ae45e81e4..4555b32e3d72ea9e0344ff3a869a6e03c3f37a32 100644 (file)
@@ -14425,7 +14425,6 @@ tsubst_omp_clauses (tree clauses, bool declare_simd, bool allow_fields,
        case OMP_CLAUSE_FROM:
        case OMP_CLAUSE_TO:
        case OMP_CLAUSE_MAP:
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_USE_DEVICE_PTR:
        case OMP_CLAUSE_IS_DEVICE_PTR:
          OMP_CLAUSE_DECL (nc)
@@ -14552,7 +14551,6 @@ tsubst_omp_clauses (tree clauses, bool declare_simd, bool allow_fields,
          case OMP_CLAUSE_COPYPRIVATE:
          case OMP_CLAUSE_LINEAR:
          case OMP_CLAUSE_REDUCTION:
-         case OMP_CLAUSE_USE_DEVICE:
          case OMP_CLAUSE_USE_DEVICE_PTR:
          case OMP_CLAUSE_IS_DEVICE_PTR:
            /* tsubst_expr on SCOPE_REF results in returning
index ab9989a5a122b907a3fda7218c6dc8dd7d06adeb..37bf050b71f38d39881709491c813aa09779aaa0 100644 (file)
@@ -6886,7 +6886,6 @@ finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd)
            }
          break;
 
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_IS_DEVICE_PTR:
        case OMP_CLAUSE_USE_DEVICE_PTR:
          field_ok = allow_fields;
index 227964cb2f6804d188238910bb41b9d6fa5164d8..70a772294efa0ada95c9fbaf3410fd222f55b253 100644 (file)
@@ -1771,7 +1771,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
          clause_code = OMP_CLAUSE_UNIFORM;
          goto add_clause;
        case OMP_LIST_USE_DEVICE:
-         clause_code = OMP_CLAUSE_USE_DEVICE;
+         clause_code = OMP_CLAUSE_USE_DEVICE_PTR;
          goto add_clause;
        case OMP_LIST_DEVICE_RESIDENT:
          clause_code = OMP_CLAUSE_DEVICE_RESIDENT;
index 62b0e64350631d113eb41285cfb3b04a2efa1539..bc904015a593a7c8ed570f36bbdc1368b56205f6 100644 (file)
@@ -7139,7 +7139,6 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
            }
          goto do_notice;
 
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_USE_DEVICE_PTR:
          flags = GOVD_FIRSTPRIVATE | GOVD_EXPLICIT;
          goto do_add;
@@ -8051,7 +8050,6 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p,
        case OMP_CLAUSE_ASYNC:
        case OMP_CLAUSE_WAIT:
        case OMP_CLAUSE_DEVICE_RESIDENT:
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_INDEPENDENT:
        case OMP_CLAUSE_NUM_GANGS:
        case OMP_CLAUSE_NUM_WORKERS:
index 676b1dfce88f62987bedd547f90830d08455f1fc..a0c3e1c9cfccc8a15daf52aa32df2c13f6b00191 100644 (file)
@@ -1957,7 +1957,6 @@ scan_sharing_clauses (tree clauses, omp_context *ctx,
          install_var_local (decl, ctx);
          break;
 
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_USE_DEVICE_PTR:
          decl = OMP_CLAUSE_DECL (c);
          if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
@@ -2314,7 +2313,6 @@ scan_sharing_clauses (tree clauses, omp_context *ctx,
        case OMP_CLAUSE_SIMD:
        case OMP_CLAUSE_NOGROUP:
        case OMP_CLAUSE_DEFAULTMAP:
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_USE_DEVICE_PTR:
        case OMP_CLAUSE__CILK_FOR_COUNT_:
        case OMP_CLAUSE_ASYNC:
@@ -15288,7 +15286,6 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
          }
        break;
 
-      case OMP_CLAUSE_USE_DEVICE:
       case OMP_CLAUSE_USE_DEVICE_PTR:
       case OMP_CLAUSE_IS_DEVICE_PTR:
        var = OMP_CLAUSE_DECL (c);
@@ -15674,14 +15671,12 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
                                    build_int_cstu (tkind_type, tkind));
            break;
 
-         case OMP_CLAUSE_USE_DEVICE:
          case OMP_CLAUSE_USE_DEVICE_PTR:
          case OMP_CLAUSE_IS_DEVICE_PTR:
            ovar = OMP_CLAUSE_DECL (c);
            var = lookup_decl_in_outer_ctx (ovar, ctx);
            x = build_sender_ref (ovar, ctx);
-           if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_PTR
-               || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE)
+           if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_PTR)
              tkind = GOMP_MAP_USE_DEVICE_PTR;
            else
              tkind = GOMP_MAP_FIRSTPRIVATE_INT;
@@ -15884,12 +15879,10 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
                                     gimple_build_assign (new_var, x));
              }
            break;
-         case OMP_CLAUSE_USE_DEVICE:
          case OMP_CLAUSE_USE_DEVICE_PTR:
          case OMP_CLAUSE_IS_DEVICE_PTR:
            var = OMP_CLAUSE_DECL (c);
-           if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_PTR
-               || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE)
+           if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_PTR)
              x = build_sender_ref (var, ctx);
            else
              x = build_receiver_ref (var, false, ctx);
index 7a5eea6d287842b10b2c7edbf11bfe8e9f63f449..23aba8ca5ffc73ead9c33cdcef7ff26e0a2d41b2 100644 (file)
@@ -8,4 +8,4 @@ program test
   !$acc host_data use_device(i)
   !$acc end host_data
 end program test
-! { dg-final { scan-tree-dump-times "pragma acc host_data use_device\\(i\\)" 1 "original" } } 
+! { dg-final { scan-tree-dump-times "pragma acc host_data use_device_ptr\\(i\\)" 1 "original" } }
index 9cc64d92e34bc3375ccbd5250f2d3d8cfa002a2e..5371378e2719a2d16a63f8de4928ca656f4b9e7d 100644 (file)
@@ -302,7 +302,8 @@ enum omp_clause_code {
      OpenMP clause: map ({alloc:,to:,from:,tofrom:,}variable-list).  */
   OMP_CLAUSE_MAP,
 
-  /* OpenMP clause: use_device_ptr (variable-list).  */
+  /* OpenACC clause: use_device (variable_list).
+     OpenMP clause: use_device_ptr (variable-list).  */
   OMP_CLAUSE_USE_DEVICE_PTR,
 
   /* OpenMP clause: is_device_ptr (variable-list).  */
@@ -315,9 +316,6 @@ enum omp_clause_code {
   /* OpenACC clause: device_resident (variable_list).  */
   OMP_CLAUSE_DEVICE_RESIDENT,
 
-  /* OpenACC clause: use_device (variable_list).  */
-  OMP_CLAUSE_USE_DEVICE,
-
   /* OpenACC clause: gang [(gang-argument-list)].
      Where
       gang-argument-list: [gang-argument-list, ] gang-argument
index 3a9479afb4cc416b908203d9004fa6483d19c17c..8211a120da87db6a896c89bbe67edf8e05ed4370 100644 (file)
@@ -1072,7 +1072,6 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
        case OMP_CLAUSE_SHARED:
        case OMP_CLAUSE_TO_DECLARE:
        case OMP_CLAUSE_LINK:
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_USE_DEVICE_PTR:
        case OMP_CLAUSE_IS_DEVICE_PTR:
        do_decl_clause:
@@ -1744,7 +1743,6 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
        case OMP_CLAUSE_SHARED:
        case OMP_CLAUSE_TO_DECLARE:
        case OMP_CLAUSE_LINK:
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_USE_DEVICE_PTR:
        case OMP_CLAUSE_IS_DEVICE_PTR:
        do_decl_clause:
index caec7605814f3b7ac60b4a5e7fec2b5aee4c2dd4..c4a180ec3945dbb19aa794a53c4b61f509c0d998 100644 (file)
@@ -327,9 +327,6 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags)
     case OMP_CLAUSE_DEVICE_RESIDENT:
       name = "device_resident";
       goto print_remap;
-    case OMP_CLAUSE_USE_DEVICE:
-      name = "use_device";
-      goto print_remap;
     case OMP_CLAUSE_TO_DECLARE:
       name = "to";
       goto print_remap;
index 2190cae847510f8a416a7451fe1a1e3d3e2be15f..d837609fefa51fdf4d05461b719fe514751740f4 100644 (file)
@@ -282,7 +282,6 @@ unsigned const char omp_clause_num_ops[] =
   1, /* OMP_CLAUSE_IS_DEVICE_PTR  */
   2, /* OMP_CLAUSE__CACHE_  */
   1, /* OMP_CLAUSE_DEVICE_RESIDENT  */
-  1, /* OMP_CLAUSE_USE_DEVICE  */
   2, /* OMP_CLAUSE_GANG  */
   1, /* OMP_CLAUSE_ASYNC  */
   1, /* OMP_CLAUSE_WAIT  */
@@ -354,7 +353,6 @@ const char * const omp_clause_code_name[] =
   "is_device_ptr",
   "_cache_",
   "device_resident",
-  "use_device",
   "gang",
   "async",
   "wait",
@@ -11612,7 +11610,6 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
          /* FALLTHRU */
 
        case OMP_CLAUSE_DEVICE_RESIDENT:
-       case OMP_CLAUSE_USE_DEVICE:
        case OMP_CLAUSE_ASYNC:
        case OMP_CLAUSE_WAIT:
        case OMP_CLAUSE_WORKER: