0ccba4ed85
OpenMP 5.1 and earlier had 2 different uses of to clause, one for target update construct with one semantics, and one for declare target directive with a different semantics. Under the hood we were using OMP_CLAUSE_TO_DECLARE to represent the latter. OpenMP 5.2 renamed the declare target clause to to enter, the old one is kept as a deprecated alias. As we are far from having full OpenMP 5.2 support, this patch adds support for the enter clause (and renames OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER with a flag to tell the spelling of the clause for better diagnostics), but doesn't deprecate the to clause on declare target just yet (that should be done as one of the last steps in 5.2 support). 2022-05-27 Jakub Jelinek <jakub@redhat.com> gcc/ * tree-core.h (enum omp_clause_code): Rename OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER. * tree.h (OMP_CLAUSE_ENTER_TO): Define. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Rename OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE, if OMP_CLAUSE_ENTER_TO, print "to" instead of "enter". * tree-nested.cc (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE. gcc/c-family/ * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ENTER. gcc/c/ * c-parser.cc (c_parser_omp_clause_name): Parse enter clause. (c_parser_omp_all_clauses): For to clause on declare target, use OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER. (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause. (c_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE. * c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause name in diagnostics instead of omp_clause_code_name[OMP_CLAUSE_CODE (c)]. gcc/cp/ * parser.cc (cp_parser_omp_clause_name): Parse enter clause. (cp_parser_omp_all_clauses): For to clause on declare target, use OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER. (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause. (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE. * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause name in diagnostics instead of omp_clause_code_name[OMP_CLAUSE_CODE (c)]. gcc/testsuite/ * c-c++-common/gomp/clauses-3.c: Add tests with enter clause instead of to or modify some existing to clauses to enter. * c-c++-common/gomp/declare-target-1.c: Likewise. * c-c++-common/gomp/declare-target-2.c: Likewise. * c-c++-common/gomp/declare-target-3.c: Likewise. * g++.dg/gomp/attrs-9.C: Likewise. * g++.dg/gomp/declare-target-1.C: Likewise. libgomp/ * testsuite/libgomp.c-c++-common/target-40.c: Modify some existing to clauses to enter. * testsuite/libgomp.c/target-41.c: Likewise. |
||
---|---|---|
.. | ||
alloc-1.c | ||
alloc-2.c | ||
alloc-3.c | ||
alloc-4.c | ||
alloc-5.c | ||
alloc-6.c | ||
alloc-7.c | ||
alloc-8.c | ||
alloc-9.c | ||
alloc-10.c | ||
allocate-1.c | ||
allocate-2.c | ||
allocate-3.c | ||
atomic-18.c | ||
atomic-19.c | ||
atomic-20.c | ||
atomic-21.c | ||
cancel-parallel-1.c | ||
cancel-taskgroup-1.c | ||
cancel-taskgroup-2.c | ||
cancel-taskgroup-3.c | ||
cancel-taskgroup-4.c | ||
critical-hint-1.c | ||
critical-hint-2.c | ||
declare_target-1.c | ||
default-1.c | ||
depend-1.c | ||
depend-2.c | ||
depend-3.c | ||
depend-inoutset-1.c | ||
depend-iterator-1.c | ||
depend-iterator-2.c | ||
depend-mutexinout-1.c | ||
depend-mutexinout-2.c | ||
depobj-1.c | ||
display-affinity-1.c | ||
error-1.c | ||
for-1.c | ||
for-1.h | ||
for-2.c | ||
for-2.h | ||
for-3.c | ||
for-4.c | ||
for-5.c | ||
for-6.c | ||
for-7.c | ||
for-8.c | ||
for-9.c | ||
for-10.c | ||
for-11.c | ||
for-12.c | ||
for-13.c | ||
for-14.c | ||
for-15.c | ||
for-16.c | ||
function-not-offloaded-aux.c | ||
function-not-offloaded.c | ||
get-mapped-ptr-1.c | ||
get-mapped-ptr-2.c | ||
get-mapped-ptr-3.c | ||
get-mapped-ptr-4.c | ||
icv-3.c | ||
icv-4.c | ||
lastprivate-conditional-1.c | ||
lastprivate-conditional-2.c | ||
lastprivate-conditional-3.c | ||
lastprivate-conditional-4.c | ||
lastprivate-conditional-5.c | ||
lastprivate-conditional-6.c | ||
lastprivate-conditional-7.c | ||
lastprivate-conditional-8.c | ||
lastprivate-conditional-9.c | ||
lastprivate-conditional-10.c | ||
loop-1.c | ||
loop-13.c | ||
loop-14.c | ||
loop-15.c | ||
masked-1.c | ||
master-combined-1.c | ||
monotonic-1.c | ||
monotonic-2.c | ||
nested-parallel-unbalanced.c | ||
nonmonotonic-1.c | ||
nonmonotonic-2.c | ||
nothing-1.c | ||
on_device_arch.h | ||
order-reproducible-1.c | ||
order-reproducible-2.c | ||
ordered-4.c | ||
pause-1.c | ||
pause-2.c | ||
pr45784.c | ||
pr64824.c | ||
pr64868.c | ||
pr66199-1.c | ||
pr66199-2.c | ||
pr66199-3.c | ||
pr66199-4.c | ||
pr66199-5.c | ||
pr66199-6.c | ||
pr66199-7.c | ||
pr66199-8.c | ||
pr66199-9.c | ||
pr66199-10.c | ||
pr66199-11.c | ||
pr66199-12.c | ||
pr66199-13.c | ||
pr66199-14.c | ||
pr69389.c | ||
pr81875.c | ||
pr83046.c | ||
pr93515.c | ||
pr94366.c | ||
pr96390.c | ||
ptr-attach-1.c | ||
reduction-1.c | ||
reduction-2.c | ||
reduction-3.c | ||
reduction-4.c | ||
reduction-5.c | ||
reduction-6.c | ||
reduction-16.c | ||
reduction-17.c | ||
refcount-1.c | ||
scope-1.c | ||
simd-1.c | ||
simd-14.c | ||
simd-15.c | ||
simd-16.c | ||
simd-17.c | ||
struct-elem-1.c | ||
struct-elem-2.c | ||
struct-elem-3.c | ||
struct-elem-4.c | ||
struct-elem-5.c | ||
target-1.c | ||
target-2.c | ||
target-10.c | ||
target-13.c | ||
target-40.c | ||
target-41.c | ||
target-42.c | ||
target-45.c | ||
target-has-device-addr-1.c | ||
target-implicit-map-1.c | ||
target-implicit-map-2.c | ||
target-in-reduction-1.c | ||
target-in-reduction-2.c | ||
target-is-accessible-1.c | ||
target-memcpy-async-1.c | ||
target-memcpy-async-2.c | ||
target-memcpy-rect-async-1.c | ||
target-memcpy-rect-async-2.c | ||
target-same-name-1-a.c | ||
target-same-name-1-b.c | ||
target-same-name-1.c | ||
task-detach-1.c | ||
task-detach-2.c | ||
task-detach-3.c | ||
task-detach-4.c | ||
task-detach-5.c | ||
task-detach-6.c | ||
task-detach-7.c | ||
task-detach-8.c | ||
task-detach-9.c | ||
task-detach-10.c | ||
task-detach-11.c | ||
task-detach-12.c | ||
task-detach-13.c | ||
task-reduction-1.c | ||
task-reduction-2.c | ||
task-reduction-3.c | ||
task-reduction-4.c | ||
task-reduction-5.c | ||
task-reduction-6.c | ||
task-reduction-7.c | ||
task-reduction-8.c | ||
task-reduction-9.c | ||
task-reduction-11.c | ||
task-reduction-12.c | ||
task-reduction-13.c | ||
task-reduction-14.c | ||
task-reduction-15.c | ||
task-reduction-16.c | ||
taskgroup-1.c | ||
taskloop-1.c | ||
taskloop-2.c | ||
taskloop-3.c | ||
taskloop-4.c | ||
taskloop-5.c | ||
taskloop-reduction-1.c | ||
taskloop-reduction-2.c | ||
taskloop-reduction-3.c | ||
taskloop-reduction-4.c | ||
taskwait-depend-1.c | ||
taskwait-depend-nowait-1.c | ||
taskwait-depend-nowait-2.c | ||
teams-1.c | ||
teams-2.c | ||
thread-limit-1.c | ||
udr-1.c | ||
unmap-infinity-2.c | ||
variable-not-offloaded.c |