[Patch][Fortran/OpenMP] Don't create "alloc:" for 'target exit data'
Jakub Jelinek
jakub@redhat.com
Wed Oct 30 15:55:00 GMT 2019
On Wed, Oct 30, 2019 at 04:48:43PM +0100, Tobias Burnus wrote:
> On 10/30/19 11:12 AM, Jakub Jelinek wrote:
> > I believe it is easier to handle it at the same spot as we do it e.g.
> > for C/C++ pointer attachments (where we create the same clauses
> > regardless of the exact construct and then drop them later), in
> > particular in gimplify_scan_omp_clauses. […]
>
> I concur. Semantically, it is not identical – but I think still okay.
>
> For 'omp exit data', 'to:'/'alloc:' mapping does not make sense and it not
> handled in libgomp's gomp_exit_data. Hence, I exclude GOMP_MAP_POINTER
> (dump: 'alloc:') and GOMP_MAP_TO_PSET (dump: 'to:'). – Those are only
> internally used, hence, user-specified 'alloc:' will get diagnosed.
>
> ['delete:'/'release:' in other directives than 'exit data' doesn't make much
> sense. Other directives accept it but their libgomp function silently ignore
> it.]
Do they?
At least the C/C++ FEs should complain/remove before it makes its way into the
middle-end. E.g. c_parser_omp_target_enter_data has:
switch (OMP_CLAUSE_MAP_KIND (*pc))
{
case GOMP_MAP_TO:
case GOMP_MAP_ALWAYS_TO:
case GOMP_MAP_ALLOC:
map_seen = 3;
break;
case GOMP_MAP_FIRSTPRIVATE_POINTER:
case GOMP_MAP_ALWAYS_POINTER:
break;
default:
map_seen |= 1;
error_at (OMP_CLAUSE_LOCATION (*pc),
"%<#pragma omp target enter data%> with map-type other "
"than %<to%> or %<alloc%> on %<map%> clause");
*pc = OMP_CLAUSE_CHAIN (*pc);
continue;
}
Haven't checked the Fortran FE.
> gcc/
> * gimplify.c (gimplify_scan_omp_clauses): Remove FE-generated
> GOMP_MAP_TO_PSET and GOMP_MAP_POINTER mapping for 'target update'
> and 'target exit data'.
>
> libgomp/
> * testsuite/libgomp.fortran/target9.f90: New.
Ok.
Jakub
More information about the Fortran
mailing list