Go to file
Sandra Loosemore 9a06e4d6a1 OpenMP: need_device_ptr and need_device_addr support for adjust_args
This patch adds support for the "need_device_addr" modifier to the
"adjust args" clause for the "declare variant" directive, and
extends/re-works the support for "need_device_ptr" as well.

This patch builds on waffl3x's recently posted patch, "OpenMP: C/C++
adjust-args numeric ranges", here.

https://gcc.gnu.org/pipermail/gcc-patches/2025-April/681806.html

In C++, "need_device_addr" supports mapping reference arguments to
device pointers.  In Fortran, it similarly supports arguments passed
by reference, the default for the language, in contrast to
"need_device_ptr" which is used to map arguments of c_ptr type.  The
C++ support is straightforward, but Fortran has some additional
wrinkles involving arrays passed by descriptor (a new descriptor must
be constructed with a pointer to the array data which is the only part
mapped to the device), plus special cases for passing optional
arguments and a whole array instead of a reference to its first element.

gcc/cp/ChangeLog
	* parser.cc (cp_finish_omp_declare_variant): Adjust error messages.

gcc/fortran/ChangeLog
	* trans-openmp.cc (gfc_trans_omp_declare_variant): Disallow
	polymorphic and optional arguments with need_device_addr for now, but
	don't reject need_device_addr entirely.

gcc/ChangeLog
	* gimplify.cc (modify_call_for_omp_dispatch): Rework logic for
	need_device_ptr and need_device_addr adjustments.

gcc/testsuite/Changelog
	* c-c++-common/gomp/adjust-args-10.c: Ignore the new sorry since the
	lack of proper diagnostic is already xfail'ed.
	* g++.dg/gomp/adjust-args-1.C: Adjust output patterns.
	* g++.dg/gomp/adjust-args-17.C: New.
	* gcc.dg/gomp/adjust-args-3.c: New.
	* gfortran.dg/gomp/adjust-args-14.f90: Don't expect this to fail now.

libgomp/ChangeLog
	* libgomp.texi: Mark need_device_addr as supported.
	* testsuite/libgomp.c-c++-common/dispatch-3.c: New.
	* testsuite/libgomp.c++/need-device-ptr.C: New.
	* testsuite/libgomp.fortran/adjust-args-array-descriptor.f90: New.
	* testsuite/libgomp.fortran/need-device-ptr.f90: New.

Co-Authored-By: Tobias Burnus <tburnus@baylibre.com>
2025-04-30 17:46:31 +00:00
.github Minor formatting fix for newly-added file from previous commit 2023-11-01 19:28:56 -04:00
INSTALL
c++tools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
config Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
contrib Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
fixincludes Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
gcc OpenMP: need_device_ptr and need_device_addr support for adjust_args 2025-04-30 17:46:31 +00:00
gnattools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
gotools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
include OpenMP: 'interop' construct - add ME support + target-independent libgomp 2025-03-22 00:28:19 +01:00
libada Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libatomic Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libbacktrace Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcc1 Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcody Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcpp Daily bump. 2025-03-28 00:23:52 +00:00
libdecnumber Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libffi Merge branch 'releases/gcc-14' into devel/omp/gcc-14 2024-08-01 11:09:11 +02:00
libgcc GCN, nvptx offloading: Host/device compatibility: Itanium C++ ABI, DSO Object Destruction API [PR119853, PR119854] 2025-04-25 18:55:33 +02:00
libgfortran Merge remote-tracking branch 'origin/releases/gcc-14' into devel/omp/gcc-14 2025-04-08 23:51:05 +02:00
libgm2 Daily bump. 2024-11-21 00:26:12 +00:00
libgo libgo: bump libgo version for GCC 14 release 2024-02-05 11:28:30 -08:00
libgomp OpenMP: need_device_ptr and need_device_addr support for adjust_args 2025-04-30 17:46:31 +00:00
libgrust Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libiberty Daily bump. 2024-09-13 00:21:45 +00:00
libitm Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libobjc Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libphobos Daily bump. 2025-03-22 00:27:43 +01:00
libquadmath LoongArch: Add LoongArch architecture detection to __float128 support in libgfortran and libquadmath [PR119408]. 2025-04-08 09:19:14 +08:00
libsanitizer Daily bump. 2024-09-06 00:22:34 +00:00
libssp Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libstdc++-v3 GCN, nvptx libstdc++: Force use of '__atomic' builtins [PR119645] 2025-04-17 09:35:51 +02:00
libvtv Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
lto-plugin Daily bump. 2024-09-05 00:22:17 +00:00
maintainer-scripts Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
zlib Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
.dir-locals.el
.gitattributes
.gitignore *: add modern gettext 2023-11-14 00:47:11 +01:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
ChangeLog.jit
ChangeLog.omp GCN, nvptx: Don't default-disable libstdc++ build 2025-03-19 10:01:51 +01:00
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS: Update my email address 2024-04-04 16:39:52 +02:00
Makefile.def Disable libstdc++ dependency for libffi 2024-05-07 11:49:57 +02:00
Makefile.in Disable libstdc++ dependency for libffi 2024-05-07 11:49:57 +02:00
Makefile.tpl Fix up postboot dependencies [PR106472] 2024-04-02 13:40:27 +02:00
README
SECURITY.txt SECURITY.txt: Drop "exploitable" in reference to hardening issues 2024-01-09 10:49:01 -05:00
ar-lib
compile
config-ml.in LoongArch: Reimplement multilib build option handling. 2023-09-15 10:42:12 +08:00
config.guess
config.rpath
config.sub
configure GCN, nvptx: Don't default-disable libstdc++ build 2025-03-19 10:01:51 +01:00
configure.ac GCN, nvptx: Don't default-disable libstdc++ build 2025-03-19 10:01:51 +01:00
depcomp
install-sh
libtool-ldflags
libtool.m4 Build: fix error in fixinclude configure 2023-11-22 11:54:33 +01:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
symlink-tree
test-driver
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.