diff options
author | Chung-Lin Tang <cltang@codesourcery.com> | 2023-07-31 07:53:24 -0700 |
---|---|---|
committer | Chung-Lin Tang <cltang@codesourcery.com> | 2023-07-31 07:56:19 -0700 |
commit | a104e9ac0ae9a7e78ec2edd0b81074946646a87d (patch) | |
tree | 3af10f8605d928435401ca81286f4b95c7d10c01 /gcc/fortran | |
parent | 7cdd0860949c6c3232e6cff1d7ca37bb5234074c (diff) | |
download | gcc-a104e9ac0ae9a7e78ec2edd0b81074946646a87d.zip gcc-a104e9ac0ae9a7e78ec2edd0b81074946646a87d.tar.gz gcc-a104e9ac0ae9a7e78ec2edd0b81074946646a87d.tar.bz2 |
OpenACC 2.7: host_data must have use_device clause requirement
This patch implements the OpenACC 2.7 change requiring the host_data construct
to have at least one use_device clause.
gcc/c/ChangeLog:
* c-parser.cc (c_parser_oacc_host_data): Add checking requiring OpenACC
host_data construct to have an use_device clause.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_oacc_host_data): Add checking requiring OpenACC
host_data construct to have an use_device clause.
gcc/fortran/ChangeLog:
* openmp.cc (resolve_omp_clauses): Add checking requiring
OpenACC host_data construct to have an use_device clause.
gcc/testsuite/ChangeLog:
* c-c++-common/goacc/host_data-2.c: Adjust testcase.
* gfortran.dg/goacc/host_data-error.f90: New testcase.
* gfortran.dg/goacc/pr71704.f90: Adjust testcase.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/openmp.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 2952cd3..234d896 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -8926,6 +8926,12 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, "%<MERGEABLE%> clause", &omp_clauses->detach->where); } + if (openacc + && code->op == EXEC_OACC_HOST_DATA + && omp_clauses->lists[OMP_LIST_USE_DEVICE] == NULL) + gfc_error ("%<host_data%> construct at %L requires %<use_device%> clause", + &code->loc); + if (omp_clauses->assume) gfc_resolve_omp_assumptions (omp_clauses->assume); } |