https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87649
Bug ID: 87649 Summary: ICE in OpenMP doacross (ordered) loop Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: omrimor2 at illinois dot edu CC: jakub at gcc dot gnu.org Target Milestone: --- Created attachment 44855 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44855&action=edit Minimal Working Example (C) An OpenMP loop construct with an ordered clause with a parameter and a nested ordered construct with no depend clause causes an internal compiler error during the 'ompexp' GIMPLE pass. This is invalid OpenMP*, but should not cause an ICE segfault. Clang returns with an error, while ICC compiles (!) the invalid code but imposes no ordering constraint. Occurs on both macOS (Homebrew, GCC 8.2.0) and a Linux cluster (GCC 7.2.0). I haven't confirmed if this is C/C++ frontend-specific or errors with Fortran as well. *The loop or loop SIMD region to which an ordered region arising from an ordered construct without a depend clause binds must have an ordered clause without the parameter specified on the corresponding loop or loop SIMD directive. (OpenMP 4.5 Specification, ยง2.13.8, pp. 168) #pragma omp parallel for ordered(1) for (int i = 0; i < 100; i++) { #pragma omp ordered array[i] = i; } macOS: Using built-in specs. COLLECT_GCC=gcc-8 COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/8.2.0/libexec/gcc/x86_64-apple-darwin18.0.0/8.2.0/lto-wrapper Target: x86_64-apple-darwin18.0.0 Configured with: ../configure --build=x86_64-apple-darwin18.0.0 --prefix=/usr/local/Cellar/gcc/8.2.0 --libdir=/usr/local/Cellar/gcc/8.2.0/lib/gcc/8 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-8 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 8.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk Thread model: posix gcc version 8.2.0 (Homebrew GCC 8.2.0) Linux: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/gcc/7.2.0/libexec/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-7.2.0/configure --with-gmp=/usr/local/gmp/6.1.0 --with-mpfr=/usr/local/mpfr/3.1.4 --with-mpc=/usr/local/mpc/1.0.3 --with-cloog=/usr/local/cloog/ --with-isl=/usr/local/isl/0.16.1 --enable-cloog-backend=isl --prefix=/usr/local/gcc/7.2.0 Thread model: posix gcc version 7.2.0 (GCC) Command line: gcc -o test1 -fopenmp test1.c Compiler output: test1.c: In function 'main': test1.c:7:10: internal compiler error: Segmentation fault: 11 #pragma omp parallel for ordered(1) ^~~ libbacktrace could not find executable to open Please submit a full bug report, with preprocessed source if appropriate. See <https://github.com/Homebrew/homebrew-core/issues> for instructions.