gcc/libgcc
Chung-Lin Tang c2e4a17adc OpenMP 5.0: requires directive
This is a merge of:
https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563393.html

This patch completes more of the reverse_offload, unified_address, and
unified_shared_memory clauses for the OpenMP 5.0 requires directive,
including runtime verification of the offload target.
(currently no offload devices actually support above features, only
warning messages are emitted)

This may possibly reverted/updated when a final patch is approved
for mainline.

2021-02-02  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/c/ChangeLog:

	* c-parser.c (c_parser_declaration_or_fndef): Set
	OMP_REQUIRES_TARGET_USED in omp_requires_mask if function has
	"omp declare target" attribute.
	(c_parser_omp_target_data): Set    OMP_REQUIRES_TARGET_USED in
	omp_requires_mask.
	(c_parser_omp_target_enter_data): Likewise.
	(c_parser_omp_target_exit_data): Likewise.
	(c_parser_omp_requires): Adjust to only mention "not implemented yet"
	for OMP_REQUIRES_DYNAMIC_ALLOCATORS.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_simple_declaration): Set
	OMP_REQUIRES_TARGET_USED in omp_requires_mask if function has
	"omp declare target" attribute.
	(cp_parser_omp_target_data): Set OMP_REQUIRES_TARGET_USED in
	omp_requires_mask.
	(cp_parser_omp_target_enter_data): Likewise.
	(cp_parser_omp_target_exit_data): Likewise.
	(cp_parser_omp_requires): Adjust to only mention "not implemented yet"
	for OMP_REQUIRES_DYNAMIC_ALLOCATORS.

gcc/fortran/ChangeLog:

	* openmp.c (gfc_check_omp_requires): Fix REVERSE_OFFLOAD typo.
	(gfc_match_omp_requires): Adjust to only mention "not implemented yet"
	for OMP_REQUIRES_DYNAMIC_ALLOCATORS.
	* parse.c ("tree.h"): Add include.
	("omp-general.h"): Likewise.
	(gfc_parse_file): Add code to merge omp_requires to omp_requires_mask.

gcc/ChangeLog:

	* omp-offload.c (omp_finish_file): Add code to reate OpenMP requires
	mask variable in .gnu.gomp_requires section if needed.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/requires-4.c: Remove prune of "not supported yet".
	* gcc/testsuite/gfortran.dg/gomp/requires-4.f90: Fix REVERSE_OFFLOAD typo.
	* gcc/testsuite/gfortran.dg/gomp/requires-8.f90: Likewise.

include/ChangeLog:

	* gomp-constants.h (GOMP_REQUIRES_UNIFIED_ADDRESS): New symbol.
	(GOMP_REQUIRES_UNIFIED_SHARED_MEMORY): Likewise.
	(GOMP_REQUIRES_REVERSE_OFFLOAD): Likewise.

libgcc/ChangeLog:

	* offloadstuff.c (__requires_mask_table): New symbol to mark start of
	.gnu.gomp_requires section.
	(__requires_mask_table_end): New symbol to mark end of
	.gnu.gomp_requires section.

libgomp/ChangeLog:

	* libgomp-plugin.h (GOMP_OFFLOAD_supported_features): New declaration.
	* libgomp.h (struct gomp_device_descr): New 'supported_features_func'
	plugin hook field.
	* oacc-host.c (host_supported_features): New host hook function.
	(host_dispatch): Initialize 'supported_features_func' host hook.
	* plugin/plugin-gcn.c (GOMP_OFFLOAD_supported_features): New function.
	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_supported_features): Likewise.
	* target.c (<stdio.h>): Add include of standard header.
	(gomp_requires_mask): New static variable.
	(__requires_mask_table): New declaration.
	(__requires_mask_table_end): Likewise.
	(gomp_load_plugin_for_device): Add loading of 'supported_features' hook.
	(gomp_target_init): Add code to summarize .gnu._gomp_requires section
	mask values, emit error if inconsistency found.

	* testsuite/libgomp.c-c++-common/requires-1.c: New test.
	* testsuite/libgomp.c-c++-common/requires-1-aux.c: New file linked with
	above test.
	* testsuite/libgomp.c-c++-common/requires-2.c: New test.
	* testsuite/libgomp.c-c++-common/requires-2-aux.c: New file linked with
	above test.

liboffloadmic/ChangeLog:

	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_supported_features):
	New function.
2021-02-02 20:34:01 +08:00
..
config [nvptx, libgcc] Fix Wbuiltin-declaration-mismatch in atomic.c 2020-09-11 13:53:21 +02:00
soft-fp soft-fp: Update soft-fp from glibc 2019-05-17 07:37:39 -07:00
ChangeLog Daily bump. 2020-08-04 00:16:58 +00:00
ChangeLog.omp [nvptx, libgcc] Fix Wbuiltin-declaration-mismatch in atomic.c 2020-09-11 13:53:21 +02:00
Makefile.in Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
config.host hurd: libgcc unwinding support over signal trampolines 2020-06-18 00:03:17 +02:00
config.in aarch64: Fix bootstrap with old binutils [PR93053] 2020-04-15 11:01:19 +02:00
configure aarch64: Fix bootstrap with old binutils [PR93053] 2020-04-15 11:01:19 +02:00
configure.ac aarch64: Fix bootstrap with old binutils [PR93053] 2020-04-15 11:01:19 +02:00
crtstuff.c Fix compilation of crtstuff.c when DEFAULT_USE_CXA_ATEXIT is false 2020-01-18 10:30:29 -05:00
dfp-bit.c Update copyright years. 2020-01-01 12:51:42 +01:00
dfp-bit.h Update copyright years. 2020-01-01 12:51:42 +01:00
divmod.c Update copyright years. 2020-01-01 12:51:42 +01:00
empty.mk
emutls.c Update copyright years. 2020-01-01 12:51:42 +01:00
enable-execute-stack-empty.c
enable-execute-stack-mprotect.c Update copyright years. 2020-01-01 12:51:42 +01:00
find-symver.awk Update copyright years. 2020-01-01 12:51:42 +01:00
fixed-bit.c Update copyright years. 2020-01-01 12:51:42 +01:00
fixed-bit.h Update copyright years. 2020-01-01 12:51:42 +01:00
fixed-obj.mk
floatunsidf.c
floatunsisf.c
floatunsitf.c
floatunsixf.c
fp-bit.c Update copyright years. 2020-01-01 12:51:42 +01:00
fp-bit.h Update copyright years. 2020-01-01 12:51:42 +01:00
gbl-ctors.h Update copyright years. 2020-01-01 12:51:42 +01:00
gcov.h Update copyright years. 2020-01-01 12:51:42 +01:00
gen-fixed.sh
generic-morestack-thread.c Update copyright years. 2020-01-01 12:51:42 +01:00
generic-morestack.c libgcc: use syscall rather than __mmap/__munmap 2020-04-07 11:30:10 -07:00
generic-morestack.h Update copyright years. 2020-01-01 12:51:42 +01:00
gstdint.h
gthr-posix.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-single.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr.h Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc-std.ver.in Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc2.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc2.h Update copyright years. 2020-01-01 12:51:42 +01:00
libgcov-driver-system.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgcov-driver.c Remove wrong bail out in prune_topn_counter. 2020-01-23 14:34:59 +01:00
libgcov-interface.c Remove duplicate declaration. 2020-03-02 13:08:49 +01:00
libgcov-merge.c Introduce -fprofile-reproducibility and support it with TOP N. 2020-02-18 14:28:22 +01:00
libgcov-profiler.c Add __gcov_indirect_call_profiler_v4_atomic. 2020-01-27 16:20:10 +01:00
libgcov-util.c gcov-tool: Flexible endian adjustment for merging coverage data 2020-05-29 11:33:33 +02:00
libgcov.h gcov-tool: Flexible endian adjustment for merging coverage data 2020-05-29 11:33:33 +02:00
memcmp.c
memcpy.c
memmove.c
memset.c
mkheader.sh Update copyright years. 2020-01-01 12:51:42 +01:00
mkmap-flat.awk Update copyright years. 2020-01-01 12:51:42 +01:00
mkmap-symver.awk Update copyright years. 2020-01-01 12:51:42 +01:00
offloadstuff.c OpenMP 5.0: requires directive 2021-02-02 20:34:01 +08:00
shared-object.mk
siditi-object.mk
static-object.mk
sync.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivhi3.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivmod.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivmodhi4.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivmodsi4.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-arm-common.inc arm: Fix up arm installed unwind.h for use in pedantic modes [PR93615] 2020-02-10 14:35:31 +00:00
unwind-c.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-compat.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-compat.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2-fde-compat.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2-fde-dip.c nios2: Support for GOT-relative DW_EH_PE_datarel encoding. 2020-01-31 16:46:50 -08:00
unwind-dw2-fde.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2-fde.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2.c libgcc: fix the handling of return address mangling [PR94891] 2020-07-13 19:11:31 +01:00
unwind-dw2.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-generic.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-pe.h arm: Fix up arm installed unwind.h for use in pedantic modes [PR93615] 2020-02-10 14:35:31 +00:00
unwind-seh.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-sjlj.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind.inc Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_end.c Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_end_preinit.c Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_start.c Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_start_preinit.c Update copyright years. 2020-01-01 12:51:42 +01:00