On 01/30/2017 02:26 AM, Thomas Schwinge wrote: > ... also there is some bug somewhere; I see: > > PASS: libgomp.fortran/examples-4/async_target-2.f90 -O0 (test for > excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/examples-4/async_target-2.f90 -O0 > execution test > PASS: libgomp.fortran/examples-4/async_target-2.f90 -O1 (test for > excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/examples-4/async_target-2.f90 -O1 > execution test > PASS: libgomp.fortran/examples-4/async_target-2.f90 -O2 (test for > excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/examples-4/async_target-2.f90 -O2 > execution test > PASS: libgomp.fortran/examples-4/async_target-2.f90 -O3 > -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions > (test for excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/examples-4/async_target-2.f90 -O3 > -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions > execution test > PASS: libgomp.fortran/examples-4/async_target-2.f90 -O3 -g (test for > excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/examples-4/async_target-2.f90 -O3 -g > execution test > PASS: libgomp.fortran/examples-4/async_target-2.f90 -Os (test for > excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/examples-4/async_target-2.f90 -Os > execution test > > ..., and: > > PASS: libgomp.fortran/target3.f90 -O0 (test for excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/target3.f90 -O0 execution test > PASS: libgomp.fortran/target3.f90 -O1 (test for excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/target3.f90 -O1 execution test > PASS: libgomp.fortran/target3.f90 -O2 (test for excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/target3.f90 -O2 execution test > PASS: libgomp.fortran/target3.f90 -O3 -fomit-frame-pointer > -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess > errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/target3.f90 -O3 -fomit-frame-pointer > -funroll-loops -fpeel-loops -ftracer -finline-functions execution test > PASS: libgomp.fortran/target3.f90 -O3 -g (test for excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/target3.f90 -O3 -g execution test > PASS: libgomp.fortran/target3.f90 -Os (test for excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/target3.f90 -Os execution test > > In all cases, the run-time error message is: > > libgomp: Pointer target of array section wasn't mapped
That problem occurred because I wasn't handling NULL pointers gomp_map_pset. Basically, that can occur when you have an nullified pointer to an array. I taught libgomp to handle that situation like gomp_map_pointer, i.e., just propagate the NULL pointer to the accelerator. This patch also fixes a bug with pointers to reference types. The approach I took in this patch is to be conservative by demoting GOMP_MAP_FIRSTPRIVATE_POINTER to GOMP_MAP_POINTER for such types. I've applied this patch to gomp-4_0-branch. Cesar