[gomp4] Properly handle allocatable scalars in acc update.

Cesar Philippidis cesar@codesourcery.com
Thu Jun 8 21:46:00 GMT 2017


This patch fixes a bug I introduced while adding support for allocatable
scalars back in April. Before, gfc_trans_oacc_executable_directive would
indiscriminately promote all GOMP_MAP_FIRSTPRIVATE_POINTER data mappings
to GOMP_MAP_ALWAYS_POINTER, because for allocatable scalars the runtime
needs to update the on-device values of both the data being pointed to
and the pointer itself. The problem with this is that the allocatable
scalar bit isn't propagated across subroutine calls. Clearly this
indiscriminate update behavior is wrong because the pointer of dummy
arguments may not get mapped onto the accelerator.

In this patch, I introduced a new acc_update bit inside the
gfc_omp_clauses struct to represent when allocatable scalars need
special treatment. As it stands, gfc_trans_omp_clauses_1 already has too
many arguments, so I thought this approach would be better. Now
gfc_trans_omp_clauses_1 can handle the allocatable scalar update directly.

I've applied this patch to gomp-4_0-branch.

Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gomp4-dummy-allocatable-scalars.diff
Type: text/x-patch
Size: 3889 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170608/12da7deb/attachment.bin>


More information about the Gcc-patches mailing list