https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110639
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> --- Created attachment 56804 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56804&action=edit gimplify.cc patch to ensure that GOVD_MAP_0LEN_ARRAY comes last (does not fix the issue) I tried the attached patch see whether it fixes the problem. It doesn't as the pointer-lookup-for-attachment seems to happen in an earlier 'for' loop than the 'for' loop that does the actual mapping for clauses on the same 'target' directive (→ gomp_map_vars_internal). Thus, either this patch is not required - or it is only required in addition; in any case, it seems as if libgomp/target.c's gomp_map_vars_internal needs to be modified.