I get the following error when compiling using gcc snapshot 4.4.0 20080704 main.c|18|internal compiler error: in pop_gimplify_context, at gimplify.c:194 See code at the end of the post and gcc configure options. Obviously when removing the -fopenmp switch the ICE go away. Also removing either the omp task or omp single directive make the error go away. The ICE also vanish if the expression inside the while loop is a constant. This error appear at all optimization level with or without debugging enabled. using the following code (reduced case...) : int main() { int i = 0; #pragma omp parallel { #pragma omp single while( i < 1 ) { #pragma omp task i++; } } return 0; } gcc configure options : $ gcc -v Using built-in specs. Target: mingw32 Configured with: ./gcc-4.4.0/configure --prefix=/mingw --enable-bootstrap --build=mingw32 --program-prefix= --with-as=/mingw/bin/as.exe --with-ld=/mingw/bin/ld.exe --with-gcc --with-gnu-ld --with-gnu-as --enable-languages=c,c++,objc,fortran --disable-nls --disable-win32-registry --disable-werror --enable-sjlj-exceptions --enable-threads=win32 --disable-symvers --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-cxx-flags='-fno-function-sections -fno-data-sections' --enable-fully-dynamic-string --enable-libgomp --enable-checking=release Thread model: win32 gcc version 4.4.0 20080704 (experimental) (GCC)
Created attachment 15896 [details] preprocessed file of the presented testcase
Confirmed, this worked in 4.3.0.
Subject: Bug 36802 Author: jakub Date: Mon Dec 8 10:36:01 2008 New Revision: 142546 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142546 Log: PR middle-end/36802 * omp-low.c (use_pointer_for_field): Only call maybe_lookup_decl on parallel and task contexts. * testsuite/libgomp.c/pr36802-1.c: New test. * testsuite/libgomp.c/pr36802-2.c: New test. * testsuite/libgomp.c/pr36802-3.c: New test. Added: trunk/libgomp/testsuite/libgomp.c/pr36802-1.c trunk/libgomp/testsuite/libgomp.c/pr36802-2.c trunk/libgomp/testsuite/libgomp.c/pr36802-3.c Modified: trunk/gcc/ChangeLog trunk/gcc/omp-low.c trunk/libgomp/ChangeLog
Your testcase has data races, but I came up with valid testcases.