]> git.ipfire.org Git - people/ms/gcc.git/commit
libgomp: Fix reverse offload issues
authorTobias Burnus <tobias@codesourcery.com>
Fri, 3 Feb 2023 10:31:53 +0000 (11:31 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 3 Feb 2023 10:31:53 +0000 (11:31 +0100)
commit0b1ce70a813b98ef2893779d14ad6c90c5d06a71
treedd44ee568730e0a2c18152a7737b8a68b63e9a4b
parentf84fdb134dec02f68fd9a39a58e726023470e537
libgomp: Fix reverse offload issues

If there is nothing to map, skip the mapping and avoid attempting to
copy 0 bytes from addrs, sizes and kinds.

Additionally, it could happen that a non-allocated address was deallocated,
such as a pointer set, leading to a free for the actual data.

libgomp/
* target.c (gomp_target_rev): Handle mapnum == 0 and avoid
freeing not allocated memory.
* testsuite/libgomp.fortran/reverse-offload-6.f90: New test.
libgomp/target.c
libgomp/testsuite/libgomp.fortran/reverse-offload-6.f90 [new file with mode: 0644]