https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71535
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.org, | |jakub at gcc dot gnu.org --- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> --- I wonder if the testcase has invalid code. On one hand, without "omp declare target" on 'Process', the compiler does not need to emit accel code for it, so it would fail to link at mkoffload/link time. On the other hand, the intention seems to be to allow code with references to standard functions (at least libm/libc), even though those functions don't have "omp declare target" on their external declarations. And, it doesn't look like that the OpenMP 4.5 spec explicitly makes this invalid. For variables, 2.10.4 mentions that "A variable referenced in a target region but not the target construct that is not declared in the target region must appear in a declare target directive." In any case, the compiler should fail more gracefully than ICE. Minimal testcase is just void foo () { asm (""); } int main () { #pragma omp target foo (); }