https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79512

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 40743
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40743&action=edit
Demonstrator patch. Uses flag_openmp_simd in DEF_GOMP_BUILTIN

This patch roughly restores the situation from before r224745.

With the patch, and after renaming the test function to main, we get:
...
$ gcc test.c -fopenmp-simd 
/tmp/ccPdaFhw.o: In function `main':
test.c:(.text+0x4e): undefined reference to `GOMP_target_ext'
collect2: error: ld returned 1 exit status
...

Here ( https://gcc.gnu.org/ml/gcc-patches/2013-10/msg02275.html ) I read about
fopenmp-simd:
...
This patch add the new option "-fopenmp-simd", which allows to use OpenMP 4.0's
"simd" pragmas without enabling OpenMP's threading or target features - and,
thus, it also doesn't require linking of libgomp.
...

The fact that libgomp is required by the generated code, seems to mean that the
test-case is not a valid fopenmp-simd testcase. This is confirmed by the fact
that "#pragma omp target teams" is not listed as supported pragma in the
gcc-patches message above.

I think the correct handling in this case would be to ignore the pragmas, which
currently is not done, and that's probably the root cause of the ICE.

Reply via email to