gcc/include
Julian Brown f5745dc142 OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic
This patch adds support for non-constant component offsets in "map"
clauses for OpenMP (and the equivalants for OpenACC), which are not able
to be sorted into order at compile time.  Normally struct accesses in
such clauses are gathered together and sorted into increasing address
order after a "GOMP_MAP_STRUCT" node: if we have variable indices,
that is no longer possible.

This version of the patch scales back the previously-posted version to
merely add a diagnostic for incorrect usage of component accesses with
variably-indexed arrays of structs: the only permitted variant is where
we have multiple indices that are the same, but we could not prove so
at compile time.  Rather than silently producing the wrong result for
cases where the indices are in fact different, we error out (e.g.,
"map(dtarr(i)%arrptr, dtarr(j)%arrptr(4:8))", for different i/j).

For now, multiple *constant* array indices are still supported (see
map-arrayofstruct-1.c).  That could perhaps be addressed with a follow-up
patch, if necessary.

This version of the patch renumbers the GOMP_MAP_STRUCT_UNORD kind to
avoid clashing with the OpenACC "non-contiguous" dynamic array support
(though that is not yet applied to mainline).

2023-08-18  Julian Brown  <julian@codesourcery.com>

gcc/
	* gimplify.cc (extract_base_bit_offset): Add VARIABLE_OFFSET parameter.
	(omp_get_attachment, omp_group_last, omp_group_base,
	omp_directive_maps_explicitly): Add GOMP_MAP_STRUCT_UNORD support.
	(omp_accumulate_sibling_list): Update calls to extract_base_bit_offset.
	Support GOMP_MAP_STRUCT_UNORD.
	(omp_build_struct_sibling_lists, gimplify_scan_omp_clauses,
	gimplify_adjust_omp_clauses, gimplify_omp_target_update): Add
	GOMP_MAP_STRUCT_UNORD support.
	* omp-low.cc (lower_omp_target): Add GOMP_MAP_STRUCT_UNORD support.
	* tree-pretty-print.cc (dump_omp_clause): Likewise.

include/
	* gomp-constants.h (gomp_map_kind): Add GOMP_MAP_STRUCT_UNORD.

libgomp/
	* oacc-mem.c (find_group_last, goacc_enter_data_internal,
	goacc_exit_data_internal, GOACC_enter_exit_data): Add
	GOMP_MAP_STRUCT_UNORD support.
	* target.c (gomp_map_vars_internal): Add GOMP_MAP_STRUCT_UNORD support.
	Detect incorrect use of variable indexing of arrays of structs.
	(GOMP_target_enter_exit_data, gomp_target_task_fn): Add
	GOMP_MAP_STRUCT_UNORD support.
	* testsuite/libgomp.c-c++-common/map-arrayofstruct-1.c: New test.
	* testsuite/libgomp.c-c++-common/map-arrayofstruct-2.c: New test.
	* testsuite/libgomp.c-c++-common/map-arrayofstruct-3.c: New test.
	* testsuite/libgomp.fortran/map-subarray-5.f90: New test.
2023-12-15 10:33:52 +00:00
..
cuda libgomp: cuda.h and omp_target_memcpy_rect cleanup 2023-07-29 13:25:03 +02:00
gdb Update copyright years. 2023-01-16 11:52:17 +01:00
ansidecl.h Update copyright years. 2023-01-16 11:52:17 +01:00
btf.h Update copyright years. 2023-01-16 11:52:17 +01:00
ChangeLog Daily bump. 2023-12-11 00:17:32 +00:00
ChangeLog-9103
ChangeLog.jit
collectorAPI.h gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
COPYING
COPYING3
ctf.h Synchronize include/ctf.h with upstream binutils/libctf. 2023-04-28 14:20:24 +01:00
demangle.h c++: mangle function template constraints 2023-12-01 16:08:25 -05:00
dwarf2.def Add some new DW_IDX_* constants 2023-12-10 14:53:02 -07:00
dwarf2.h Update copyright years. 2023-01-16 11:52:17 +01:00
dyn-string.h Update copyright years. 2023-01-16 11:52:17 +01:00
environ.h Update copyright years. 2023-01-16 11:52:17 +01:00
fibheap.h Update copyright years. 2023-01-16 11:52:17 +01:00
filenames.h Update copyright years. 2023-01-16 11:52:17 +01:00
floatformat.h Update copyright years. 2023-01-16 11:52:17 +01:00
fnmatch.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-c-fe.def Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-c-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-cp-fe.def Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-cp-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
getopt.h Update copyright years. 2023-01-16 11:52:17 +01:00
gomp-constants.h OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic 2023-12-15 10:33:52 +00:00
hashtab.h Update copyright years. 2023-01-16 11:52:17 +01:00
hsa.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
hsa_ext_amd.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
hsa_ext_image.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
leb128.h Update copyright years. 2023-01-16 11:52:17 +01:00
libcollector.h gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
libfcollector.h gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
libiberty.h Update copyright years. 2023-01-16 11:52:17 +01:00
longlong.h Update copyright years. 2023-01-16 11:52:17 +01:00
lto-symtab.h Update copyright years. 2023-01-16 11:52:17 +01:00
md5.h Update copyright years. 2023-01-16 11:52:17 +01:00
objalloc.h Update copyright years. 2023-01-16 11:52:17 +01:00
obstack.h Update copyright years. 2023-01-16 11:52:17 +01:00
partition.h Update copyright years. 2023-01-16 11:52:17 +01:00
plugin-api.h PR29961, plugin-api.h: "Could not detect architecture endianess" 2023-08-07 22:59:36 +02:00
safe-ctype.h Update copyright years. 2023-01-16 11:52:17 +01:00
sha1.h libiberty: Use x86 HW optimized sha1 2023-11-28 13:14:05 +01:00
simple-object.h Update copyright years. 2023-01-16 11:52:17 +01:00
sort.h Update copyright years. 2023-01-16 11:52:17 +01:00
spincount.h x86: set spincount 1 for x86 hybrid platform 2023-10-12 12:47:17 +08:00
splay-tree.h Update copyright years. 2023-01-16 11:52:17 +01:00
symcat.h Update copyright years. 2023-01-16 11:52:17 +01:00
timeval-utils.h Update copyright years. 2023-01-16 11:52:17 +01:00
vtv-change-permission.h Update copyright years. 2023-01-16 11:52:17 +01:00
xregex.h
xregex2.h Update copyright years. 2023-01-16 11:52:17 +01:00
xtensa-config.h Update copyright years. 2023-01-16 11:52:17 +01:00
xtensa-dynconfig.h gcc-4.5 build fixes 2023-08-07 22:59:36 +02:00