Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]
authorTobias Burnus <tobias@codesourcery.com>
Fri, 30 Sep 2022 11:27:32 +0000 (13:27 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 30 Sep 2022 11:37:18 +0000 (13:37 +0200)
commit10a116104969b3ecc9ea4abdd5436c66fd78d537
tree76f910b475ce550a88ea27ec3b95dd1770adbdfb
parent9b8ffbb8a0cadd68bf7887c5655a29ec04060111
Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

OpenMP 5.1 added has_device_addr and relaxed the restrictions for
use_device_ptr, including processing non-type(c_ptr) arguments as
if has_device_addr was used. (There is a semantic difference.)

For completeness, the likewise change was done for 'use_device_ptr',
where non-type(c_ptr) arguments now use use_device_addr.

Finally, a warning for 'device(omp_{initial,invalid}_device)' was
silenced on the way as affecting the new testcase.

PR fortran/105318

gcc/fortran/ChangeLog:
* openmp.cc (resolve_omp_clauses): Update is_device_ptr restrictions
for OpenMP 5.1 and map to has_device_addr where applicable; map
use_device_ptr to use_device_addr where applicable.
Silence integer-range warning for device(omp_{initial,invalid}_device).

libgomp/ChangeLog:
* testsuite/libgomp.fortran/is_device_ptr-2.f90: New test.

gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/is_device_ptr-1.f90: Remove dg-error.
* gfortran.dg/gomp/is_device_ptr-2.f90: Likewise.
* gfortran.dg/gomp/is_device_ptr-3.f90: Update tree-scan-dump.
gcc/fortran/openmp.cc
gcc/testsuite/gfortran.dg/gomp/is_device_ptr-1.f90
gcc/testsuite/gfortran.dg/gomp/is_device_ptr-2.f90
gcc/testsuite/gfortran.dg/gomp/is_device_ptr-3.f90
libgomp/testsuite/libgomp.fortran/is_device_ptr-2.f90 [new file with mode: 0644]