https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94290
Bug ID: 94290 Summary: [gfortran] OpenMP target teams distribute default firstprivate causes failure to map back values from device Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: jhdavis at udel dot edu CC: jakub at gcc dot gnu.org Target Milestone: --- Created attachment 48099 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48099&action=edit Target teams distribute default(firstprivate) reproducible Hello, This bug report is from the SOLLVE team regarding default(firstprivate) in an offloading construct. --- SUMMARY --- On a target teams distribute clause the default(firstprivate) clause we are seeing a failure to map back changes made on the device. In the attached reproducible we test both the 'private' and 'first' aspects of the clause for both scalars and arrays on the device and then check the results on the host. Changing the default(firstprivate) in both parts of the test to firstprivate(privatized, privatized_array) causes the test to work as expected. The version of the test in our suite is availible here: https://github.com/SOLLVE/sollve_vv/blob/d031050b40edf3cd261219d649e932b4f4743ff6/tests/4.5/target_teams_distribute/test_target_teams_distribute_default_firstprivate.F90 --- DETAILS --- gfortran version: 9.2.0 System: x86_64-pc-linux-gnu (Summit) Config options: ../gcc9.2/configure --enable-offload-targets=nvptx-none --with-cuda-driver-include=/software/apps/cuda/9.2//include --with-cuda-driver-lib=/software/apps/cuda/9.2//lib64 --disable-bootstrap --disable-multilib --enable-languages=c,c++,fortran,lto --prefix=/software/apps/gcc/9.2 No compiler output. Runtime output: test_firstprivate_private gave 1024 expected 0 test_firstprivate_first gave 1024 expected 0 Command line to trigger bug: gfortran -fopenmp -ffree-line-length-none default_firstprivate_bug.F90 -o default_firstprivate_bug.F90.o ./default_firstprivate_bug.F90.o Best, Josh Davis