Re: [PATCH] OpenMP/Fortran: Fix present modifier in map clauses for allocatables

Tobias Burnus <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
Paul-Antoine Arras wrote:
> The OpenMP 6.0 spec reads (Section 7.9.6 "map Clause"):
> "Unless otherwise specified, if a list item is a referencing variable then the
> effect of the map clause is applied to its referring pointer and, if a
> referenced pointee exists, its referenced pointee."
>
> In other words, the map clause (and its modifiers) applies to the array
> descriptor (unconditionally), and also to the array data if it is allocated.
>
> Without this patch, the semantics enforced in libgomp is incorrect: an
> allocatable is deemed present only if it is allocated. Correct semantics: an
> allocatable is in the present table as long as its descriptor is mapped, even if
> no data exists.
>
> libgomp/ChangeLog:
>
> 	* target.c (gomp_present_fatal): New function.
> 	(gomp_map_vars_internal): For a Fortran allocatable array, present
> 	causes runtime termination only if the descriptor is not mapped.
> 	(gomp_update): Call gomp_present_fatal.
> 	* testsuite/libgomp.fortran/map-alloc-present-1.f90: New test.

LGTM.

Thanks,

Tobias
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.