https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115138
--- Comment #16 from Iain Buclaw <ibuclaw at gcc dot gnu.org> --- (In reply to Richard Biener from comment #15) > Note the opover.d compile doesn't even use -O3, so this is all extremely > odd. It would somehow point at a miscompile of the stage2 compiler by > the stage1 compiler manifesting itself only in this change ... > > So the logical next step would be to bisect stage1/stage2 object files > of d21 and see which stage2 object is miscompiled. After removing `--enable-multilib` I've managed to replicate this too. Confirmed that GDCFLAGS ignores whatever's in `--with-build-config=bootstrap-O3` when compared next to Stage1 (`-g -O2` vs `-g`) ``` gdc -c -g -O2 -fversion=IN_GCC -fno-PIE -fno-exceptions -fasynchronous-unwind-tables -Wall -Wdeprecated -fno-common -o d/opover.o -MT d/opover.o -MMD -MP -MF d/.deps/opover.TPo -I../../gcc/d -J../../gcc/d/dmd -J../../gcc/d/dmd/res ../../gcc/d/dmd/opover.d g++ -std=c++11 -fno-PIE -c -DIN_GCC_FRONTEND -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -Id -I../../gcc -I../../gcc/d -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o d/d-attribs.o -MT d/d-attribs.o -MMD -MP -MF d/.deps/d-attribs.TPo ../../gcc/d/d-attribs.cc ``` Stage2 (`-O2 -g` vs `-O3 -g -fno-checking`) ``` /repos/gcc/build.O3/./prev-gcc/gdc -B/repos/gcc/build.O3/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -O2 -g -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime/gcc -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime -I/repos/gcc/libphobos/libdruntime -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -c -g -O2 -fversion=IN_GCC -fno-PIE -fno-exceptions -fasynchronous-unwind-tables -Wall -Wdeprecated -fno-common -o d/opover.o -MT d/opover.o -MMD -MP -MF d/.deps/opover.TPo -I../../gcc/d -J../../gcc/d/dmd -J../../gcc/d/dmd/res ../../gcc/d/dmd/opover.d /repos/gcc/build.O3/./prev-gcc/xg++ -B/repos/gcc/build.O3/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -I/repos/gcc/libstdc++-v3/libsupc++ -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -fno-PIE -c -DIN_GCC_FRONTEND -O3 -g -fno-checking -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -Id -I../../gcc -I../../gcc/d -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o d/d-attribs.o -MT d/d-attribs.o -MMD -MP -MF d/.deps/d-attribs.TPo ../../gcc/d/d-attribs.cc ``` Stage3: (`-O2 -g` vs `-O3 -g -fchecking=1`) ``` /repos/gcc/build.O3/./prev-gcc/gdc -B/repos/gcc/build.O3/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -O2 -g -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime/gcc -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime -I/repos/gcc/libphobos/libdruntime -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -c -g -O2 -fversion=IN_GCC -fno-PIE -fno-exceptions -fasynchronous-unwind-tables -Wall -Wdeprecated -fno-common -o d/opover.o -MT d/opover.o -MMD -MP -MF d/.deps/opover.TPo -I../../gcc/d -J../../gcc/d/dmd -J../../gcc/d/dmd/res ../../gcc/d/dmd/opover.d /repos/gcc/build.O3/./prev-gcc/xg++ -B/repos/gcc/build.O3/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -I/repos/gcc/libstdc++-v3/libsupc++ -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -fno-PIE -c -DIN_GCC_FRONTEND -O3 -g -fchecking=1 -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -Id -I../../gcc -I../../gcc/d -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o d/d-attribs.o -MT d/d-attribs.o -MMD -MP -MF d/.deps/d-attribs.TPo ../../gcc/d/d-attribs.cc ``` Also seen in the Makefiles stage1-gcc/Makefile:GDCFLAGS = -g -O2 stage1-gcc/Makefile:CXXFLAGS = -g stage2-gcc/Makefile:GDCFLAGS = -g -O2 stage2-gcc/Makefile:CXXFLAGS = -O3 -g -fno-checking stage3-gcc/Makefile:GDCFLAGS = -g -O2 stage3-gcc/Makefile:CXXFLAGS = -O3 -g -fchecking=1