http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55497
Bug #: 55497 Summary: Local array (char[]) initialized with a size taken from a static variable creates an ICE Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: greg.bu...@gmail.com The following lines (41+42) crashes GCC 4.7.2 with an "internal compiler error: Segmentation fault" message: https://github.com/Ummon/D-LAN/blob/1.1.0beta13/application/Core/FileManager/priv/Cache/DataWriter.cpp#L42 If the lines are rewritten as this, it compiles without crashing (obviously): static const quint32 BUFFER_SIZE = 42; char buffer[BUFFER_SIZE]; It compiles well with GCC 4.6.2 Command line and GCC 4.7.2 message: make[1]: Entering directory `/home/gburri/D-LAN/application/Core/FileManager' g++ -c -pipe -std=c++0x -g -fPIC -Wall -Wno-parentheses -D_REENTRANT -DQT_WEBKIT -DDEBUG -DFILEMANAGER_LIBRARY -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I. -I../.. -I.tmp/debug -o .tmp/debug/DataWriter.o priv/Cache/DataWriter.cpp priv/Cache/DataWriter.cpp: In constructor 'FM::DataWriter::DataWriter(FM::Chunk&)': priv/Cache/DataWriter.cpp:62:1: internal compiler error: Segmentation fault