https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93226
Sebastian Galindo <sebastian.galindo143 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sebastian.galindo143@gmail.
| |com
--- Comment #7 from Sebastian Galindo <sebastian.galindo143 at gmail dot com>
---
(In reply to Tobias Burnus from comment #6)
Hi, I think the fix is sufficient and I would not write more tests.
The device_resident clause modify the declaration of variable with the
attribute 'omp declare target' that marks the variable offloadable and insert
it for registration when the offload device loads the image (this is the
GOMP_offload_register_ver call).
But the operation linked to the clause namelist becomes OMP_MAP_FORCE_ALLOC,
so, when the GENERIC translation wants to generate the OMP_LIST_MAP code, it
includes the force alloc modifier that results in the double mapping.
Some other clauses also adds the 'omp declare target' attribute to the
declaration (e.g. create, copyin, etc) but there is no remapping since the
device_resident is the only one that maps to FORCE_ALLOC operation.
I think it is sufficient, I tested some simple combinations of directives
including create or copyin to validate the behavior, and it works well.