http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49223
Summary: Internal compiler error when using OpenMP Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: ttsiod...@gmail.com Created attachment 24391 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24391 Preprocessed output from input C++ file that triggers the bug. When using -fopenmp, compiling my open source renderer ( http://users.softlab.ece.ntua.gr/~ttsiod/renderer.html ) triggers an internal compiler error. This did not happen with previous versions of GCC (I've added OpenMP support and seen it work fine since GCC 4.3.2). bash$ make ... g++ -DHAVE_CONFIG_H -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I./../lib3ds-1.3.0/ -fopenmp -O3 -g -Wall -Wextra -fomit-frame-pointer -ffast-math -funsafe-math-optimizations -mtune=native -msse -mrecip -mfpmath=sse -msse2 -mssse3 -DNDEBUG -MT renderer-Rasterizers.o -MD -MP -MF .deps/renderer-Rasterizers.Tpo -c -o renderer-Rasterizers.o `test -f 'Rasterizers.cc' || echo './'`Rasterizers.cc Rasterizers.cc: In member function 'void RasterizeScene<TriangleCarrier>::DrawTriangles(int, int) const': Rasterizers.cc:250:100: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. I attach the preprocessed output that easily reproduces the bug. With -fopenmp, the compiler crashes: bash$ g++ -c -fopenmp -O3 -g -Wall -Wextra -fomit-frame-pointer -ffast-math -funsafe-math-optimizations -mtune=native -msse -mrecip -mfpmath=sse -msse2 -mssse3 renderer-Rasterizers.i ...without it, it works: bash$ g++ -c -O3 -g -Wall -Wextra -fomit-frame-pointer -ffast-math -funsafe-math-optimizations -mtune=native -msse -mrecip -mfpmath=sse -msse2 -mssse3 renderer-Rasterizers.i Version of GCC (g++ -v): Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: /build/src/gcc-4.6-20110513/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --disable-multilib --disable-libstdcxx-pch --enable-checking=release Thread model: posix gcc version 4.6.0 20110513 (prerelease) (GCC) System Type (uname -a): Linux home 2.6.38-ARCH #1 SMP PREEMPT Fri May 13 07:54:18 UTC 2011 i686 Intel(R) Celeron(R) CPU E3400 @ 2.60GHz GenuineIntel GNU/Linux Kind regards, Thanassis Tsiodras, Dr.-Ing.