https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97782
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> --- Technically, the issue is (was): The input_location is used which is obtained when finishing the the block (= '!$acc end kernels') - or rather whatever comes before and bumps the line location.