]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
openmp: Adjust position of OMP_CLAUSE_INDIRECT in OpenMP clauses
authorKwok Cheung Yeung <kcy@codesourcery.com>
Wed, 3 Jan 2024 14:34:39 +0000 (14:34 +0000)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Wed, 3 Jan 2024 15:15:17 +0000 (15:15 +0000)
Move OMP_CLAUSE_INDIRECT so that it is outside of the range checked by
OMP_CLAUSE_SIZE and OMP_CLAUSE_DECL.

2024-01-03  Kwok Cheung Yeung  <kcy@codesourcery.com>

gcc/c/
* c-parser.cc (c_parser_omp_clause_name): Move handling of indirect
clause to correspond to alphabetical order.

gcc/cp/
* parser.cc (cp_parser_omp_clause_name): Move handling of indirect
clause to correspond to alphabetical order.

gcc/
* tree-core.h (enum omp_clause_code): Move OMP_CLAUSE_INDIRECT to before
OMP_CLAUSE__SIMDUID_.
* tree.cc (omp_clause_num_ops): Update position of entry for
OMP_CLAUSE_INDIRECT to correspond with omp_clause_code.
(omp_clause_code_name): Likewise.

gcc/c/c-parser.cc
gcc/cp/parser.cc
gcc/tree-core.h
gcc/tree.cc

index 64e436010d5e41c7449e34ff99a371e28e53eeea..e7b74fb07f02d31a34fa1327e689eaaed0a4c99e 100644 (file)
@@ -14899,10 +14899,10 @@ c_parser_omp_clause_name (c_parser *parser)
            result = PRAGMA_OMP_CLAUSE_IN_REDUCTION;
          else if (!strcmp ("inbranch", p))
            result = PRAGMA_OMP_CLAUSE_INBRANCH;
-         else if (!strcmp ("indirect", p))
-           result = PRAGMA_OMP_CLAUSE_INDIRECT;
          else if (!strcmp ("independent", p))
            result = PRAGMA_OACC_CLAUSE_INDEPENDENT;
+         else if (!strcmp ("indirect", p))
+           result = PRAGMA_OMP_CLAUSE_INDIRECT;
          else if (!strcmp ("is_device_ptr", p))
            result = PRAGMA_OMP_CLAUSE_IS_DEVICE_PTR;
          break;
index 1a6b53933a7047cb0eb2e1ccd09e75a572aeff8d..37536faf2cf7f0a6575bc870c5fff41f067b2a37 100644 (file)
@@ -37645,10 +37645,10 @@ cp_parser_omp_clause_name (cp_parser *parser)
            result = PRAGMA_OMP_CLAUSE_IN_REDUCTION;
          else if (!strcmp ("inbranch", p))
            result = PRAGMA_OMP_CLAUSE_INBRANCH;
-         else if (!strcmp ("indirect", p))
-           result = PRAGMA_OMP_CLAUSE_INDIRECT;
          else if (!strcmp ("independent", p))
            result = PRAGMA_OACC_CLAUSE_INDEPENDENT;
+         else if (!strcmp ("indirect", p))
+           result = PRAGMA_OMP_CLAUSE_INDIRECT;
          else if (!strcmp ("is_device_ptr", p))
            result = PRAGMA_OMP_CLAUSE_IS_DEVICE_PTR;
          break;
index d1c7136c20456d0b4d78d03618d2e5d7e2eafd59..8a89462bd7ecac52fcdc11c0b57ccf7c190572b3 100644 (file)
@@ -350,9 +350,6 @@ enum omp_clause_code {
   /* OpenMP clause: doacross ({source,sink}:vec).  */
   OMP_CLAUSE_DOACROSS,
 
-  /* OpenMP clause: indirect [(constant-integer-expression)].  */
-  OMP_CLAUSE_INDIRECT,
-
   /* Internal structure to hold OpenACC cache directive's variable-list.
      #pragma acc cache (variable-list).  */
   OMP_CLAUSE__CACHE_,
@@ -497,6 +494,9 @@ enum omp_clause_code {
   /* OpenMP clause: filter (integer-expression).  */
   OMP_CLAUSE_FILTER,
 
+  /* OpenMP clause: indirect [(constant-integer-expression)].  */
+  OMP_CLAUSE_INDIRECT,
+
   /* Internally used only clause, holding SIMD uid.  */
   OMP_CLAUSE__SIMDUID_,
 
index 82eff2bf34da8cd6c2d6ff622b76e741319b667c..8aee3ef18d8214ed248380768563a469e2eb0ed7 100644 (file)
@@ -269,7 +269,6 @@ unsigned const char omp_clause_num_ops[] =
   2, /* OMP_CLAUSE_MAP  */
   1, /* OMP_CLAUSE_HAS_DEVICE_ADDR  */
   1, /* OMP_CLAUSE_DOACROSS  */
-  1, /* OMP_CLAUSE_INDIRECT  */
   2, /* OMP_CLAUSE__CACHE_  */
   2, /* OMP_CLAUSE_GANG  */
   1, /* OMP_CLAUSE_ASYNC  */
@@ -316,6 +315,7 @@ unsigned const char omp_clause_num_ops[] =
   0, /* OMP_CLAUSE_ORDER  */
   0, /* OMP_CLAUSE_BIND  */
   1, /* OMP_CLAUSE_FILTER  */
+  1, /* OMP_CLAUSE_INDIRECT  */
   1, /* OMP_CLAUSE__SIMDUID_  */
   0, /* OMP_CLAUSE__SIMT_  */
   0, /* OMP_CLAUSE_INDEPENDENT  */
@@ -362,7 +362,6 @@ const char * const omp_clause_code_name[] =
   "map",
   "has_device_addr",
   "doacross",
-  "indirect",
   "_cache_",
   "gang",
   "async",
@@ -409,6 +408,7 @@ const char * const omp_clause_code_name[] =
   "order",
   "bind",
   "filter",
+  "indirect",
   "_simduid_",
   "_simt_",
   "independent",