gcc/libgomp
Julian Brown 9316ad3b43 OpenMP/Fortran: Combined directives with map/firstprivate of same symbol
This patch fixes a case where a combined directive (e.g. "!$omp target
parallel ...") contains both a map and a firstprivate clause for the
same variable.  When the combined directive is split into two nested
directives, the outer "target" gets the "map" clause, and the inner
"parallel" gets the "firstprivate" clause, like so:

  !$omp target parallel map(x) firstprivate(x)

  -->

  !$omp target map(x)
    !$omp parallel firstprivate(x)
      ...

When there is no map of the same variable, the firstprivate is distributed
to both directives, e.g. for 'y' in:

  !$omp target parallel map(x) firstprivate(y)

  -->

  !$omp target map(x) firstprivate(y)
    !$omp parallel firstprivate(y)
      ...

This is not a recent regression, but appear to fix a long-standing ICE.
(The included testcase is based on one by Tobias.)

2022-12-06  Julian Brown  <julian@codesourcery.com>

gcc/fortran/
	* trans-openmp.cc (gfc_add_firstprivate_if_unmapped): New function.
	(gfc_split_omp_clauses): Call above.

libgomp/
	* testsuite/libgomp.fortran/combined-directive-splitting-1.f90: New
	test.
2022-12-14 14:11:45 +00:00
..
config OpenMP: omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices 2022-12-06 06:03:50 -08:00
plugin libgomp: Handle OpenMP's reverse offloads 2022-12-10 13:42:08 +01:00
testsuite OpenMP/Fortran: Combined directives with map/firstprivate of same symbol 2022-12-14 14:11:45 +00:00
.gitattributes
acc_prof.h Update copyright years. 2022-01-03 10:42:10 +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. 2022-01-03 10:42:10 +01:00
affinity.c Update copyright years. 2022-01-03 10:42:10 +01:00
alloc.c libgomp: Don't define GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC for _aligned_malloc [PR105745] 2022-05-28 08:30:47 +02:00
allocator.c openmp: Call dlopen with "libmemkind.so.0" rather than "libmemkind.so" 2022-06-10 21:19:51 +02:00
atomic.c Update copyright years. 2022-01-03 10:42:10 +01:00
barrier.c Update copyright years. 2022-01-03 10:42:10 +01:00
ChangeLog Daily bump. 2022-12-11 00:17:43 +00:00
ChangeLog.graphite
config.h.in Refactor '-ldl' handling for libgomp proper and plugins 2022-05-12 15:11:30 +02:00
configure Revert "sphinx: add --with-sphinx-build" 2022-11-14 09:35:05 +01:00
configure.ac Revert "sphinx: add --with-sphinx-build" 2022-11-14 09:35:05 +01:00
configure.tgt LoongArch Port: libgomp 2022-03-29 17:43:35 +08:00
critical.c Update copyright years. 2022-01-03 10:42:10 +01:00
env.c libgomp: Fix up build on mingw [PR107641] 2022-11-12 09:50:04 +01:00
error.c Update copyright years. 2022-01-03 10:42:10 +01:00
fortran.c libgomp: Add omp_in_explicit_task support 2022-10-12 18:39:20 +02:00
hashtab.h Update copyright years. 2022-01-03 10:42:10 +01:00
icv-device.c OpenMP: omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices 2022-12-06 06:03:50 -08:00
icv.c OpenMP: omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices 2022-12-06 06:03:50 -08:00
iter.c Update copyright years. 2022-01-03 10:42:10 +01:00
iter_ull.c Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp-plugin.c libgomp/nvptx: Prepare for reverse-offload callback handling 2022-10-24 17:04:08 +02:00
libgomp-plugin.h Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
libgomp.h libgomp: Handle OpenMP's reverse offloads 2022-12-10 13:42:08 +01:00
libgomp.map libgomp/nvptx: Prepare for reverse-offload callback handling 2022-10-24 17:04:08 +02:00
libgomp.spec.in
libgomp.texi Fortran/OpenMP: align/allocator modifiers to the allocate clause 2022-12-09 21:45:37 +01:00
libgomp_f.h.in Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp_g.h openmp: Add taskwait nowait depend support [PR105378] 2022-05-24 09:12:44 +02:00
lock.c Update copyright years. 2022-01-03 10:42:10 +01:00
loop.c libgomp: Fix up two non-GOMP_USE_ALIGNED_WORK_SHARES related issues [PR105358] 2022-04-26 08:57:17 +02:00
loop_ull.c libgomp: Fix up two non-GOMP_USE_ALIGNED_WORK_SHARES related issues [PR105358] 2022-04-26 08:57:17 +02:00
Makefile.am Refactor '-ldl' handling for libgomp proper and plugins 2022-05-12 15:11:30 +02:00
Makefile.in Revert "sphinx: support Sphinx in build system" 2022-11-14 09:35:06 +01:00
oacc-async.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-cuda.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-host.c libgomp: Handle OpenMP's reverse offloads 2022-12-10 13:42:08 +01:00
oacc-init.c OpenMP: Move omp requires checks to libgomp 2022-07-04 13:52:02 +02:00
oacc-int.h Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-mem.c Support OpenACC 'declare create' with Fortran allocatable arrays, part II [PR106643, PR96668] 2022-11-02 20:51:41 +01:00
oacc-parallel.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-plugin.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-plugin.h Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-profiling.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-target.c
omp.h.in libgomp: Add omp_in_explicit_task support 2022-10-12 18:39:20 +02:00
omp_lib.f90.in libgomp: Add omp_in_explicit_task support 2022-10-12 18:39:20 +02:00
omp_lib.h.in libgomp: Add omp_in_explicit_task support 2022-10-12 18:39:20 +02:00
openacc.f90 Update copyright years. 2022-01-03 10:42:10 +01:00
openacc.h Update copyright years. 2022-01-03 10:42:10 +01:00
openacc_lib.h Update copyright years. 2022-01-03 10:42:10 +01:00
ordered.c Update copyright years. 2022-01-03 10:42:10 +01:00
parallel.c Update copyright years. 2022-01-03 10:42:10 +01:00
priority_queue.c Update copyright years. 2022-01-03 10:42:10 +01:00
priority_queue.h Update copyright years. 2022-01-03 10:42:10 +01:00
scope.c Update copyright years. 2022-01-03 10:42:10 +01:00
sections.c libgomp: Fix up two non-GOMP_USE_ALIGNED_WORK_SHARES related issues [PR105358] 2022-04-26 08:57:17 +02:00
secure_getenv.h Update copyright years. 2022-01-03 10:42:10 +01:00
single.c Update copyright years. 2022-01-03 10:42:10 +01:00
splay-tree.c libgomp: Handle OpenMP's reverse offloads 2022-12-10 13:42:08 +01:00
splay-tree.h libgomp: Handle OpenMP's reverse offloads 2022-12-10 13:42:08 +01:00
target.c libgomp: Handle OpenMP's reverse offloads 2022-12-10 13:42:08 +01:00
task.c libgomp: Add omp_in_explicit_task support 2022-10-12 18:39:20 +02:00
taskloop.c Update copyright years. 2022-01-03 10:42:10 +01:00
team.c Update copyright years. 2022-01-03 10:42:10 +01:00
teams.c Update copyright years. 2022-01-03 10:42:10 +01:00
work.c libgomp: Fix up two non-GOMP_USE_ALIGNED_WORK_SHARES related issues [PR105358] 2022-04-26 08:57:17 +02:00