https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105745
Bug ID: 105745 Summary: Conditional OpenMP directive fails with GCC 12 Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: reiter.christoph at gmail dot com CC: jakub at gcc dot gnu.org Target Milestone: --- Downstream issue: https://github.com/msys2/MINGW-packages/issues/11729 The following example crashes with GCC 12.1.0, but works fine with GCC 11.3.0: // g++ -fopenmp -o broken.exe broken.c; ./broken.exe; echo $? int main() { #pragma omp parallel for if (0) for (int idx = 0; idx < 0; ++idx) { } return 0; } * Removing the "if (0)" condition makes it work again * Replacing libgomp-1.dll with the one from GCC 11.3 also makes things work again. * Another example that crashes is "#pragma omp for schedule(dynamic)" This is on 32/64 bit Windows.