Created attachment 30665 [details] preprocessed file that miscompiles Using built-in specs. COLLECT_GCC=gcc-4.8.1 COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.8.1/work/gcc-4.8.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-cloog --disable-isl-version-check --enable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.1/python --enable-checking=release --disable-libgcj --enable-libstdcxx-time --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.8.1 p1.0, pie-0.5.6' --disable-libstdcxx-pch Thread model: posix gcc version 4.8.1 (Gentoo 4.8.1 p1.0, pie-0.5.6) The command: gc -DHAVE_INTTYPES=1 -O2 -Wall -Wextra -I/usr/include/SDL -I/usr/include/AL -I/usr/include/libmodplug -o snd_flac.o -c snd_flac.cpp Notes: - even '-O' triggers the bug - at '-O2', for whatever the reason, '-fno-guess-branch-probability' makes things work
Given that the attached testcase isn't self-contained, it would be helpful if you could state where exactly the miscompilation happens, why do you think it is miscompilation and what to look for.
By "miscompiles", in this case I mean there's no error during compilation, but the produced executable fails to work. I'm not very familiar with the code of the project, that this file comes from, but it's a quite complex bit of C++, which makes it difficult (on my skil level) to tell what exactly goes wrong. I've only managed to find which source file was the apparent culprit of the crash upon running.
Then the report is useless. I don't think anybody is going to bother verifying the whole compilation unit without knowing what to look for, and with no reproducer there is nothing to do.
How could I narrow it down then ?
Feedback not forthcoming.