Hi, the -O1 and -O2 options cause an internal compiler error in my newly compiled g++ 4.2.1. Omitting this option compiles without any apparent problems and the ubuntu 06/10 g++, i.e. gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5), also compiles it fine, with and without the -O2 or -O1. I still have the old g++ installed in the standard location.
Here is the output of gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) my command line was /opt/gcc4.2.1/bin/g++-4.2 -O2 -c -save-temps bug2.cpp and produced this output bug2.cpp: In function int main(): bug2.cpp:16: internal compiler error: in convert_move, at expr.c:363 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. -- Summary: -O1 and -O2 options cause internal compiler error Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Max dot Moorkamp at gmx dot net GCC build triplet: i486-linux-gnu GCC host triplet: i486-linux-gnu GCC target triplet: i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32950