]> git.ipfire.org Git - thirdparty/gcc.git/commit
openacc: No attach/detach present/release mappings for array descriptors
authorJulian Brown <julian@codesourcery.com>
Mon, 27 Jul 2020 13:29:02 +0000 (06:29 -0700)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 18:07:25 +0000 (15:07 -0300)
commit21a992500a6ced4c0e66d335cf1893c91f2d41b7
tree8f7279a4f320f0082cb5c3e633ede39e1d96e5ad
parentda8b922b7a06a2c2fe8e619188ed013210a9cf5b
openacc: No attach/detach present/release mappings for array descriptors

Standalone attach and detach clauses should not create present/release
mappings for Fortran array descriptors (e.g. used when we have a pointer
to an array), both because it is unnecessary and because those mappings
will be incorrectly subject to reference counting. Simply omitting the
mappings means we just use GOMP_MAP_TO_PSET and GOMP_MAP_{ATTACH,DETACH}
mappings for array descriptors.

That requires a tweak in gimplify.c, since we may now see GOMP_MAP_TO_PSET
without a preceding data-movement mapping.

2020-08-03  Julian Brown  <julian@codesourcery.com>
    Thomas Schwinge  <thomas@codesourcery.com>

gcc/fortran/
* trans-openmp.c (gfc_trans_omp_clauses): Don't create present/release
mappings for array descriptors.

gcc/
* gimplify.c (gimplify_omp_target_update): Allow GOMP_MAP_TO_PSET
without a preceding data-movement mapping.

gcc/testsuite/
* gfortran.dg/goacc/attach-descriptor.f90: Update pattern output. Add
scanning of gimplify dump.

libgomp/
* testsuite/libgomp.oacc-fortran/attach-descriptor-1.f90: Don't run for
shared-memory devices.  Extend with further checking.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
gcc/fortran/trans-openmp.c
gcc/gimplify.c
gcc/testsuite/gfortran.dg/goacc/attach-descriptor.f90
libgomp/testsuite/libgomp.oacc-fortran/attach-descriptor-1.f90