http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59085
Bug ID: 59085 Summary: internal compiler error: Segmentation fault Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: filip.7an at gmail dot com Created attachment 31198 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31198&action=edit The preprocessed file When compiling a small piece of C++11 code the compiler encountered a fatal error -segmentation fault- which does not allow the compilation to proceed. The problem first appear when I start using a thread_local static variable -of stringstream type- in a template class. The g++ version in use is: . g++ (rev5, Built by MinGW-W64 project) 4.8.1 . The compilation command is: . g++ --std=c++11 main.cpp -v -save-temps -o test.exe . OS Windows 7 SP 1. Attached is available the preprocessed file of a piece of code which generate the fault. Compiler output: d:\Logger - Copy>g++ --std=c++11 main.cpp -v -save-temps -o test.exe Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/program\ files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.1/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-4.8.1/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 - -with-sysroot=/tmp/x64-481-posix-seh-r5/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,l to --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic -string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-d ebug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-a rch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/tmp/mingw-prereq/x86_64-w64-mingw32-static --with-mpfr=/tmp/mingw-prereq/x 86_64-w64-mingw32-static --with-mpc=/tmp/mingw-prereq/x86_64-w64-mingw32-static --with-isl=/tmp/mingw-prereq/x86_64-w64-mingw32-static --with-cloog=/t mp/mingw-prereq/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='rev5, Built by MinGW-W64 project' --with-bugurl=http://sourcef orge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/tmp/x64-481-posix-seh-r5/libs/include -I/tmp/mingw-prereq/x64-zlib/include -I/tmp/mingw-prereq/x86_64 -w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/tmp/x64-481-posix-seh-r5/libs/include -I/tmp/mingw-prereq/x64-zlib/include -I/tmp/mingw-prereq/x86 _64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/tmp/x64-481-posix-seh-r5/libs/lib -L/tmp/mingw-prereq/x64-zlib/lib -L/tmp/mingw-prereq/x86 _64-w64-mingw32-static/lib -L/tmp/x64-481-posix-seh-r5/mingw64/opt/lib ' Thread model: posix gcc version 4.8.1 (rev5, Built by MinGW-W64 project) COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-save-temps' '-o' 'test.exe' '-shared-libgcc' '-mtune=core2' '-march=nocona' c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.1/cc1plus.exe -E -quiet -v -iprefix c:\progr am files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/ -D_REENTRANT main.cpp -mtune=core2 -march=nocona -std= c++11 -fpch-preprocess -o main.ii ignoring duplicate directory "c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c+ +" ignoring duplicate directory "c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c+ +/x86_64-w64-mingw32" ignoring duplicate directory "c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c+ +/backward" ignoring duplicate directory "c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.8.1/include" ignoring nonexistent directory "C:/Temp/msys64/tmp/x64-481-posix-seh-r5/mingw64C:/Temp/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../inc lude" ignoring duplicate directory "c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.8.1/include-fi xed" ignoring duplicate directory "c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../. ./x86_64-w64-mingw32/include" ignoring nonexistent directory "C:/Temp/msys64/tmp/x64-481-posix-seh-r5/mingw64/mingw/include" #include "..." search starts here: #include <...> search starts here: c:\program files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++ c:\program files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32 c:\program files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/backward c:\program files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include c:\program files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include-fixed c:\program files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/include End of search list. COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-save-temps' '-o' 'test.exe' '-shared-libgcc' '-mtune=core2' '-march=nocona' c:/program files/mingw-builds/x64-4.8.1-posix-seh-rev5/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.1/cc1plus.exe -fpreprocessed main.ii -quiet -dumpbase main.cpp -mtune=core2 -march=nocona -auxbase main -std=c++11 -version -o main.s GNU C++ (rev5, Built by MinGW-W64 project) version 4.8.1 (x86_64-w64-mingw32) compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++ (rev5, Built by MinGW-W64 project) version 4.8.1 (x86_64-w64-mingw32) compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 6bfbc2230a87690b06c64b5273a5ad00 main.cpp:68:1: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See <http://sourceforge.net/projects/mingw-w64> for instructions.