https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80502
Eric Gallager <egallager at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-08-01 CC| |egallager at gcc dot gnu.org Ever confirmed|0 |1 Severity|normal |enhancement --- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> --- (In reply to Evan Nemerson from comment #0) > Created attachment 41250 [details] > define _OPENMP_SIMD when -fopenmp-simd or -fopenmp is passed > > _OPENMP is (correctly) only defined for full OpenMP; when only -fopenmp-simd > is used there doesn't seem to be any way to detect in the preprocessor that > the compiler supports OpenMP SIMD pragmas. > > It would be nice if there were a macro to determine whether they are > supported so we could do something like > > #if (defined(_OPENMP) && (_OPENMP >= 201307L)) || \ > (defined(_OPENMP_SIMD) && (_OPENMP_SIMD >= 201307L)) > #pragma omp simd > #endif > > AFAIK ICC is the only compiler with a feature like -fopenmp-simd (they call > it -openmp-simd), and they don't define anything either. I've reported the > issue to them, but in the meantime it seems GCC can choose whatever it wants > without creating any compatibility issues. Defining _OPENMP_SIMD to the > version of OpenMP supported (just like _OPENMP does) seems logicial to me. > I've attached a fairly trivial patch. Patches go to the gcc-patches mailing list. Confirming as an enhancement.