https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100573
--- Comment #19 from Alexander Monakov <amonakov at gcc dot gnu.org> --- Ah, does the issue arise because foo._omp_fn.0 is (before the patch) callable in two contexts, in one it's called from host and should be 'omp target entrypoint', and in the other it's called from offloaded code and bears 'omp declare target'? If so, I think omp-expand code should make 'omp target entrypoint' prevail over 'omp declare target'?