https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100573
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Guess that is because the functions that have #pragma omp target teams directive in it are marked declare target to. So, either we'd need to play with macros etc. to make sure that those functions aren't declare target to but the ones with #pragma omp distribute are, or better we should fix this. Will have a look tomorrow. Basically this is about #pragma omp declare target void foo (void) { int a = 0; #pragma omp target map(tofrom:+a) a++; } #pragma omp end declare target int main () { foo (); } Encountering #pragma omp target (except for reverse-offload) in a target region is undefined, but if it is never called from there and only from host routines, we should compile/link it (even when we can just abort or whatever else if called in the offloaded code).