https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109701
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED CC| |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- This is a user error. The OpenMP standard makes reduction vars mapped on target only on combined constructs with the target construct, which is not the case here. If you'd use !$omp target teams distribute parallel do simd if(target:is_GPU) reduction(max:max_diff) collapse(2) then max_diff would be mapped. But as it is on a different constructs, the standard rules apply there and max_diff is firstprivatized instead (as it is scalar, no defaultmap clause is used etc.). So, if that isn't what you want, you need to map it explicitly map(tofrom:max_diff) or so on the target.