[Bug fortran/90743] Fortran 'allocatable' in OpenACC/OpenMP target offloading regions

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 5 11:17:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90743

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Thomas Schwinge from comment #2)
> 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?

It is undefined behavior, so we shouldn't be testing it.


More information about the Gcc-bugs mailing list