summaryrefslogtreecommitdiff
path: root/libgomp/oacc-parallel.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-06-19 00:14:24 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2019-06-19 00:14:24 +0200
commit4017da8d1ccc205b51ad4dbfcb63b799ad9c9a51 (patch)
tree135dceff521920b841c745107ae1a1c697a275b3 /libgomp/oacc-parallel.c
parent6f7c1f65027e3372ce540398e55781f84bf575d3 (diff)
downloadgcc-4017da8d1ccc205b51ad4dbfcb63b799ad9c9a51.tar.gz
[PR90743] Fortran 'allocatable' with OpenACC data/OpenMP 'target' 'map' clauses
Test what OpenMP 5.0 has to say on this topic. And, do the same for OpenACC. libgomp/ PR fortran/90743 * oacc-parallel.c (GOACC_parallel_keyed): Handle NULL mapping case. * testsuite/libgomp.fortran/target-allocatable-1-1.f90: New file. * testsuite/libgomp.fortran/target-allocatable-1-2.f90: Likewise. * testsuite/libgomp.oacc-fortran/allocatable-1-1.f90: Likewise. * testsuite/libgomp.oacc-fortran/allocatable-1-2.f90: Likewise. From-SVN: r272447
Diffstat (limited to 'libgomp/oacc-parallel.c')
-rw-r--r--libgomp/oacc-parallel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
index e56330f6226..0c2cfa05a43 100644
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -325,9 +325,12 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *),
devaddrs = gomp_alloca (sizeof (void *) * mapnum);
for (i = 0; i < mapnum; i++)
- devaddrs[i] = (void *) (tgt->list[i].key->tgt->tgt_start
- + tgt->list[i].key->tgt_offset
- + tgt->list[i].offset);
+ if (tgt->list[i].key != NULL)
+ devaddrs[i] = (void *) (tgt->list[i].key->tgt->tgt_start
+ + tgt->list[i].key->tgt_offset
+ + tgt->list[i].offset);
+ else
+ devaddrs[i] = NULL;
if (aq == NULL)
acc_dev->openacc.exec_func (tgt_fn, mapnum, hostaddrs, devaddrs, dims,
tgt);