diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-02-15 11:20:32 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-02-15 11:21:11 +0100 |
commit | edaf1d607860075c5ff4ade20c58b3f578ed5489 (patch) | |
tree | 0cf7e54a07af25ca400d326d5a6487b11d980afd /libgomp/target.c | |
parent | c7a9655be60cb4f224d1e5906bfe8ae227b5a3a0 (diff) | |
download | gcc-edaf1d607860075c5ff4ade20c58b3f578ed5489.zip gcc-edaf1d607860075c5ff4ade20c58b3f578ed5489.tar.gz gcc-edaf1d607860075c5ff4ade20c58b3f578ed5489.tar.bz2 |
libgomp: Fix reverse-offload for GOMP_MAP_TO_PSET
libgomp/
* target.c (gomp_target_rev): Dereference ptr
to get device address.
* testsuite/libgomp.fortran/reverse-offload-5.f90: Add test
for unallocated allocatable.
Diffstat (limited to 'libgomp/target.c')
-rw-r--r-- | libgomp/target.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libgomp/target.c b/libgomp/target.c index b4ea2c5..483851c 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -3580,8 +3580,14 @@ gomp_target_rev (uint64_t fn_ptr, uint64_t mapnum, uint64_t devaddrs_ptr, } int k; n2 = NULL; - cdata[i].present = true; + /* Dereference devaddrs[j] to get the device addr. */ + assert (devaddrs[j] - sizes[j] == cdata[i].devaddr); + devaddrs[j] = *(uint64_t *) (uintptr_t) (devaddrs[i] + + sizes[j]); + cdata[j].present = true; cdata[j].devaddr = devaddrs[j]; + if (devaddrs[j] == 0) + continue; k = gomp_map_cdata_lookup (cdata, devaddrs, kinds, sizes, j, devaddrs[j], devaddrs[j] + sizeof (void*), |