Richard's GCC test repository for https://forge.sourceware.org/ experimenting.
  • C++ 30.7%
  • C 30.2%
  • Ada 14.4%
  • D 6.1%
  • Go 5.7%
  • Other 12.4%
Find a file
Julian Brown 3f8c748311 OpenMP: Expand "declare mapper" mappers for target {enter,exit,} data directives
This patch allows 'declare mapper' mappers to be used on 'omp target
data', 'omp target enter data' and 'omp target exit data' directives.
For each of these, only explicit mappings are supported, unlike for
'omp target' directives where implicit uses of variables inside an
offload region might trigger mappers also.

Add support for C and C++.

The patch also adjusts 'map kind decay' to match OpenMP 5.2 semantics,
which is particularly important with regard to 'exit data' operations.

gcc/c-family/
	* c-common.h (c_omp_region_type): Add C_ORT_EXIT_DATA,
	C_ORT_OMP_EXIT_DATA.
	(c_omp_instantiate_mappers): Add region type parameter.
	* c-omp.cc (omp_split_map_kind, omp_join_map_kind,
	omp_map_decayed_kind): New functions.
	(omp_instantiate_mapper): Add ORT parameter.  Implement map kind decay
	for instantiated mapper clauses.
	(c_omp_instantiate_mappers): Add ORT parameter, pass to
	omp_instantiate_mapper.

gcc/c/
	* c-parser.cc (c_parser_omp_target_data): Instantiate mappers for
	'omp target data'.
	(c_parser_omp_target_enter_data): Instantiate mappers for 'omp target
	enter data'.
	(c_parser_omp_target_exit_data): Instantiate mappers for 'omp target
	exit data'.
	(c_parser_omp_target): Add c_omp_region_type argument to
	c_omp_instantiate_mappers call.
	* c-tree.h (c_omp_instantiate_mappers): Remove spurious prototype.

gcc/cp/
	* parser.cc (cp_parser_omp_target_data): Instantiate mappers for 'omp
	target data'.
	(cp_parser_omp_target_enter_data): Instantiate mappers for 'omp target
	enter data'.
	(cp_parser_omp_target_exit_data): Instantiate mappers for 'omp target
	exit data'.
	(cp_parser_omp_target): Add c_omp_region_type argument to
	c_omp_instantiate_mappers call.
	* pt.cc (tsubst_omp_clauses): Instantiate mappers for OMP regions other
	than just C_ORT_OMP_TARGET.
	(tsubst_expr): Update call to tsubst_omp_clauses for OMP_TARGET_UPDATE,
	OMP_TARGET_ENTER_DATA, OMP_TARGET_EXIT_DATA stanza.
	* semantics.cc (cxx_omp_map_array_section): Avoid calling
	build_array_ref for non-array/non-pointer bases (error reported
	already).

gcc/testsuite/
	* c-c++-common/gomp/declare-mapper-15.c: New test.
	* c-c++-common/gomp/declare-mapper-16.c: New test.
	* g++.dg/gomp/declare-mapper-1.C: Adjust expected scan output.
2026-04-29 12:12:13 +02:00
.forgejo top-level: Rename forgejo sanity checks 2026-02-27 15:08:12 +01:00
.github
c++tools Update copyright years. 2026-01-02 09:56:11 +01:00
config Daily bump. 2026-04-15 08:16:45 +00:00
contrib Daily bump. 2026-04-23 00:16:32 +00:00
fixincludes Daily bump. 2026-02-16 00:16:25 +00:00
gcc OpenMP: Expand "declare mapper" mappers for target {enter,exit,} data directives 2026-04-29 12:12:13 +02:00
gnattools Daily bump. 2026-01-10 00:16:49 +00:00
gotools
include Daily bump. 2026-02-06 00:16:39 +00:00
INSTALL
libada Update copyright years. 2026-01-02 09:56:11 +01:00
libatomic Daily bump. 2026-02-22 00:16:27 +00:00
libbacktrace Update copyright years. 2026-01-02 10:47:06 +01:00
libcc1 Daily bump. 2026-01-16 00:16:30 +00:00
libcody Update Copyright year in ChangeLog files 2026-01-01 18:58:28 +01:00
libcpp Daily bump. 2026-04-22 00:16:28 +00:00
libdecnumber Daily bump. 2026-01-10 00:16:49 +00:00
libffi Daily bump. 2026-01-30 00:16:31 +00:00
libga68 Daily bump. 2026-03-22 00:16:21 +00:00
libgcc Daily bump. 2026-04-24 00:16:27 +00:00
libgcobol Daily bump. 2026-04-03 00:16:27 +00:00
libgfortran Daily bump. 2026-04-18 00:16:31 +00:00
libgm2 Daily bump. 2026-04-22 00:16:28 +00:00
libgo libgo: use -Wc,-shared-libgcc on Solaris 2025-12-19 15:23:49 -08:00
libgomp Daily bump. 2026-04-29 00:16:40 +00:00
libgrust Update copyright years. 2026-01-02 09:56:11 +01:00
libiberty Daily bump. 2026-03-06 00:16:27 +00:00
libitm Daily bump. 2026-02-13 00:16:32 +00:00
libobjc Update copyright years. 2026-01-02 09:56:11 +01:00
libphobos Daily bump. 2026-04-22 00:16:28 +00:00
libquadmath Daily bump. 2026-01-02 00:16:23 +00:00
libsanitizer libsanitizer: Fix up build against latest kernel headers 2026-04-29 11:14:03 +02:00
libssp Update copyright years. 2026-01-02 09:56:11 +01:00
libstdc++-v3 libstdc++: Test ATOMIC_*_LOCK_FREE macros for <stdatomic.h> 2026-04-29 11:33:12 +02:00
libvtv Update copyright years. 2026-01-02 09:56:11 +01:00
lto-plugin Update copyright years. 2026-01-02 09:56:11 +01:00
maintainer-scripts Daily bump. 2026-04-23 00:16:32 +00:00
zlib Daily bump. 2025-12-30 00:16:33 +00:00
.b4-config
.dir-locals.el
.editorconfig editorconfig: Add explicit tab_width when indent_size != 8 2025-10-28 15:06:51 +00:00
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2026-04-29 00:16:40 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in toplevel: Unbreak Ada build [PR123490] 2026-01-10 11:36:25 +01:00
config.guess
config.rpath
config.sub
configure AMDGCN: Disable subdirectory configuration for unsupported GAS and LD 2026-02-18 17:32:33 +00:00
configure.ac AMDGCN: Disable subdirectory configuration for unsupported GAS and LD 2026-02-18 17:32:33 +00:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 build: Cherry-pick libtool.m4 support for GNU ld *_sol2 emulations 2025-12-29 12:09:35 +01:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS: Add myself to write after approval and DCO 2026-04-28 17:00:09 +08:00
Makefile.def a68: support for Algol 68 code in libga68 and initial transput 2025-12-30 22:45:51 +01:00
Makefile.in Makefile.tpl: Implement per-stage GDCFLAGS [PR116975] 2026-02-05 14:25:08 +01:00
Makefile.tpl Makefile.tpl: Implement per-stage GDCFLAGS [PR116975] 2026-02-05 14:25:08 +01:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
SECURITY.txt a68: top-level misc files 2025-11-30 01:52:24 +01:00
symlink-tree bugzilla: remove gcc-bugs@ mailing list address 2026-01-09 11:10:38 +01:00
test-driver
ylwrap

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.