gcc/libgomp
Tobias Burnus a8caeaacf4 OpenMP: Allocate directive for static vars, clean up
For the 'allocate' directive, remove the sorry for static variables and
just keep using normal memory, but honor the requested alignment and set
a DECL_ATTRIBUTE in case a target may want to make use of this later on.
The documentation is updated accordingly.

The C diagnostic to check for predefined allocators (req. for static vars)
failed to accept GCC's ompx_gnu_... allocator, now fixed. (Fortran was
already okay; but both now use new common #defined value for checking.)
And while Fortran common block variables are still rejected, the check
has been improved as before the sorry diagnostic did not work for
common blocks in modules.

Finally, for 'allocate' clause on the target/task/taskloop directives,
there is now a warning for omp_thread_mem_alloc (i.e. predefined allocator
with access = thread), which is undefined behavior according to the
OpenMP specification.

And, last, testing showed that var decl + static_assert sets TREE_USED
but does not produce a statement list in C, which did run into an assert
in gimplify. This special case is now also handled.

gcc/c/ChangeLog:

	* c-parser.cc (c_parser_omp_allocate): Set alignment for alignof;
	accept static variables and fix predef allocator check.

gcc/fortran/ChangeLog:

	* openmp.cc (is_predefined_allocator): Use gomp-constants.h consts.
	* trans-common.cc (translate_common): Reject OpenMP allocate directives.
	* trans-decl.cc (gfc_finish_var_decl): Handle allocate directive
	for static variables.
	(gfc_trans_deferred_vars): Update for the latter.

gcc/ChangeLog:

	* gimplify.cc (gimplify_bind_expr): Fix corner case for OpenMP
	allocate directive.
	(gimplify_scan_omp_clauses): Warn if omp_thread_mem_alloc is used
	as allocator with the target/task/taskloop directive.

include/ChangeLog:

	* gomp-constants.h (GOMP_OMP_PREDEF_ALLOC_MAX,
	GOMP_OMPX_PREDEF_ALLOC_MIN, GOMP_OMPX_PREDEF_ALLOC_MAX,
	GOMP_OMP_PREDEF_ALLOC_THREADS): New defines.

libgomp/ChangeLog:

	* allocator.c: Add static asserts for news
	GOMP_OMP{,X}_PREDEF_ALLOC_{MIN,MAX} range values.
	* libgomp.texi (OpenMP Impl. Status): Allocate directive for
	static vars is now supported. Refer to PR for allocate clause.
	(Memory allocation): Update for static vars; minor word tweaking.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/allocate-9.c: Update for removed sorry.
	* gfortran.dg/gomp/allocate-15.f90: Likewise.
	* gfortran.dg/gomp/allocate-pinned-1.f90: Likewise.
	* gfortran.dg/gomp/allocate-4.f90: Likewise; add dg-error for
	previously missing diagnostic.
	* c-c++-common/gomp/allocate-18.c: New test.
	* c-c++-common/gomp/allocate-19.c: New test.
	* gfortran.dg/gomp/allocate-clause.f90: New test.
	* gfortran.dg/gomp/allocate-static-2.f90: New test.
	* gfortran.dg/gomp/allocate-static.f90: New test.
2024-10-07 10:45:14 +02:00
..
config OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
plugin OpenMP: Add support for 'self_maps' to the 'require' directive 2024-09-24 10:53:59 +02:00
testsuite c++: Implement C++23 P2718R0 - Wording for P2644R1 Fix for Range-based for Loop [PR107637] 2024-09-24 20:24:57 +02:00
.gitattributes
acc_prof.h Update copyright years. 2024-01-03 12:19:35 +01:00
acinclude.m4 libgomp: fix typo in mold linker detection 2022-06-28 10:35:32 +02:00
aclocal.m4 libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
affinity-fmt.c Update copyright years. 2024-01-03 12:19:35 +01:00
affinity.c Update copyright years. 2024-01-03 12:19:35 +01:00
alloc.c Update copyright years. 2024-01-03 12:19:35 +01:00
allocator.c OpenMP: Allocate directive for static vars, clean up 2024-10-07 10:45:14 +02:00
atomic.c Update copyright years. 2024-01-03 12:19:35 +01:00
barrier.c Update copyright years. 2024-01-03 12:19:35 +01:00
basic-allocator.c Update copyright years. 2024-01-03 12:19:35 +01:00
ChangeLog Daily bump. 2024-09-28 00:19:05 +00:00
ChangeLog.graphite
config.h.in Refactor '-ldl' handling for libgomp proper and plugins 2022-05-12 15:11:30 +02:00
configure libgomp: Fix up FLOCK fallback handling [PR113192] 2024-01-10 13:32:02 +01:00
configure.ac libgomp: Fix up FLOCK fallback handling [PR113192] 2024-01-10 13:32:02 +01:00
configure.tgt libgomp: Define config_path for hppa*-*-linux* 2024-02-11 20:23:14 +00:00
critical.c Update copyright years. 2024-01-03 12:19:35 +01:00
env.c libgomp, openmp: Add ompx_gnu_pinned_mem_alloc 2024-07-01 10:59:59 +00:00
error.c Update copyright years. 2024-01-03 12:19:35 +01:00
fortran.c OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
hashtab.h Update copyright years. 2024-01-03 12:19:35 +01:00
icv-device.c Update copyright years. 2024-01-03 12:19:35 +01:00
icv.c Update copyright years. 2024-01-03 12:19:35 +01:00
iter_ull.c Update copyright years. 2024-01-03 12:19:35 +01:00
iter.c Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp_f.h.in Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp_g.h Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp-plugin.c Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp-plugin.h OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
libgomp.h OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
libgomp.map OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
libgomp.spec.in
libgomp.texi OpenMP: Allocate directive for static vars, clean up 2024-10-07 10:45:14 +02:00
lock.c Update copyright years. 2024-01-03 12:19:35 +01:00
loop_ull.c Update copyright years. 2024-01-03 12:19:35 +01:00
loop.c Update copyright years. 2024-01-03 12:19:35 +01:00
Makefile.am build: Derive object names in make_sunver.pl 2024-05-07 13:14:05 +02:00
Makefile.in build: Derive object names in make_sunver.pl 2024-05-07 13:14:05 +02:00
oacc-async.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-cuda.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-host.c OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
oacc-init.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-int.h Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-mem.c OpenACC 2.7: Adjust acc_map_data/acc_unmap_data interaction with reference counters 2024-04-16 09:04:11 +00:00
oacc-parallel.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-plugin.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-plugin.h Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-profiling.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-target.c
omp_lib.f90.in OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
omp_lib.h.in OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
omp.h.in OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
openacc_lib.h OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*} 2024-02-27 17:30:38 +01:00
openacc.f90 OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*} 2024-02-27 17:30:38 +01:00
openacc.h Update copyright years. 2024-01-03 12:19:35 +01:00
ordered.c Update copyright years. 2024-01-03 12:19:35 +01:00
parallel.c Update copyright years. 2024-01-03 12:19:35 +01:00
priority_queue.c Update copyright years. 2024-01-03 12:19:35 +01:00
priority_queue.h Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
scope.c Update copyright years. 2024-01-03 12:19:35 +01:00
sections.c Update copyright years. 2024-01-03 12:19:35 +01:00
secure_getenv.h Update copyright years. 2024-01-03 12:19:35 +01:00
single.c Update copyright years. 2024-01-03 12:19:35 +01:00
splay-tree.c Update copyright years. 2024-01-03 12:19:35 +01:00
splay-tree.h Update copyright years. 2024-01-03 12:19:35 +01:00
target-indirect.c Update copyright years. 2024-01-03 12:19:35 +01:00
target.c libgomp: with USM, init 'link' variables with host address 2024-09-24 17:41:39 +02:00
task.c Update copyright years. 2024-01-03 12:19:35 +01:00
taskloop.c Update copyright years. 2024-01-03 12:19:35 +01:00
team.c Update copyright years. 2024-01-03 12:19:35 +01:00
teams.c Update copyright years. 2024-01-03 12:19:35 +01:00
work.c Update copyright years. 2024-01-03 12:19:35 +01:00