On Wed, Jun 01, 2016 at 02:35:44PM -0700, Cesar Philippidis wrote: > This patch teaches c and c++ front ends and omp-low how to deal with > subarray involving GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} data > mappings. As the libgomp test case shows, it might be possible for a > subarray to have zero length. This patch fixes that. > > I also updated *parser_oacc_declare not to handle GOMP_MAP_POINTER, > because subarray pointers are now firstprivate. > > Is this OK for trunk?
Ok with me if that is the semantics OpenACC wants for zero length array sections (which would surprise me, but it is up to you to discuss the semantics you want). Basically, in OpenMP 4.5, it has been voted in that zero length array sections don't cause mapping, but rather just resolve its address to either some device pointer if the array section points into an already mapped object, or NULL if it corresponds to something not mapped yet. As GNU extension, GCC still handles zero length objects (not array sections) differently (by mapping them). Jakub