https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90743
Thomas Schwinge <tschwinge at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Device-side 'malloc' for |Fortran 'allocatable' in |Fortran 'allocatable' |OpenACC/OpenMP target |scalar |offloading regions --- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> --- Thanks for your comment; I wasn't aware of the (default) '-frealloc-lhs' behavior (PR90741), and indeed that's supported inside offloading regions, too. (In reply to Jakub Jelinek from comment #1) > The code in the region could deallocate (c) or > do similar stuff, and while that might be undefined with some offloading > specs under some conditions, there are many cases where it must be valid. Indeed that's not permitted per my reading of OpenMP 5.0 -- but it does seem to work in the GCC implementation, inside an offloading region to 'deallocate' and then re-'allocate', which seems to make the device object "detached" from the host object. Is that something we should thus be testing (with a comment: "implementation-defined behavior"), or should we not test such things?