https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95654
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> --- Created attachment 49222 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49222&action=edit Slightly reduced example, compile with gfortran -fopenmp -O1 -ftracer Some testing; with gfortran -fopenmp -O1 -ftracer it shows something like: -31 =?= 64 The expected output is the last value of the loop iteration ("lastprivate"), i.e. (b-1+1)*2 = 32*2 = 64. – When running the target section on the host (-foffload=disable) it works, which indicates either a shared-memory vs. non-shared issue or an nvptx problem. At a glance, the original dump looks fine; it seems as if either the .omp_data_i_28(D)->d1 = d1_9; .omp_data_i_28(D)->d2 = d2_11; is not executed or the PHI handling goes wrong.