http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707
Bug #: 53707 Summary: compiler generates wrong code Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: galtge...@o2.pl Using built-in specs. COLLECT_GCC=gcc-4.6.3 COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-linux-gnu/4.6.3/lto-wrapper Target: i686-pc-linux-gnu Configured with: /mnt/workbox/builds/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.6.3 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.3/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check --with-cloog-include=/usr/include/cloog-ppl --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/i686-pc-linux-gnu/4.6.3/python --enable-checking=release --disable-libgcj --with-arch=i686 --enable-objc-gc --enable-languages=c,c++,objc,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.6.3 p1.3, pie-0.5.1' --disable-libstdcxx-pch Thread model: posix gcc version 4.6.3 (Gentoo 4.6.3 p1.3, pie-0.5.1) g++-4.6.3 -std=gnu++0x -O3 -fomit-frame-pointer -march=native -c tools.cpp -o ui-tools.o (without preprocessor switches, as they won't matter for preprocessed sources) no warnings with the above line (though quite a few with -Wall, but not in the affected part of code, it would seem) The attached preprocessed sources produce *right* code, to get the *wrong* code, remove 'string test(n);' (which should be a no-op there) from the 'for(unsigned n = 0; n < Codes; n++)' around line 54977.