https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102330
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- program p i = 0 !$omp task shared(i) i = 1 !$omp end task !$omp taskwait !$acc parallel loop do i = 1, 8 end do end also ICEs, it just needs the iterator that is marked addressable during omp-low.c which has code to regimplify statements that access such variables, but it seems the problematic stmts are emitted only during omp-expand.c. The various expand_omp_* loop expansions have DECL_P (...) && TREE_ADDRESSABLE (...) conditions in various spots, but perhaps OpenACC loop expansion doesn't.