------- Comment #5 from sdack at gmx dot de 2007-02-16 19:03 ------- What I now did was the following: I set CFLAGS, CXXFLAGS, LIBCFLAGS, LIBCXXFLAGS and BOOT_CFLAGS on the command line to make to:
"-pipe -march=athlon-xp -msse -mmmx -m3dnow -mfpmath=sse -O3 -mpreferred-stack-boundary=6 -falign-functions=64 -falign-jumps=64 -fomit-frame-pointer -fforce-addr -fno-keep-static-consts -fgcse-sm -fgcse-las -fgcse-after-reload -floop-optimize2 -fsched2-use-superblocks -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-vectorize -ftracer -fsplit-ivs-in-unroller -fvariable-expansion-in-unroller -freorder-blocks-and-partition" I want to do this to see what I get as a result. I then get during the first build of libcpp this: ... make[3]: Entering directory `/home/sven/obj/stage1-libcpp' gcc -I../../gcc-4.1.2/libcpp -I. -I../../gcc-4.1.2/libcpp/../include -I../../gcc-4.1.2/libcpp/include -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -I../../gcc-4.1.2/libcpp -I. -I../../gcc-4.1.2/libcpp/../include -I../../gcc-4.1.2/libcpp/include -c -o charset.o -MT charset.o -MD -MP -MF .deps/charset.Po ../../gcc-4.1.2/libcpp/charset.c ... None of the flags I passed are being used but I currently do not see a reason why they should not. Later on libgcc: ... /home/sven/obj/./gcc/xgcc -B/home/sven/obj/./gcc/ -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -B/home/sven/gnu/i686-pc-linux-gnu/lib/ -isystem /home/sven/gnu/i686-pc-linux-gnu/include -isystem /home/sven/gnu/i686-pc-linux-gnu/sys-include -O2 -O2 -pipe -march=athlon-xp -msse -mmmx -m3dnow -mfpmath=sse -O3 -mpreferred-stack-boundary=6 -falign-functions=64 -falign-jumps=64 -fomit-frame-pointer -fforce-addr -fno-keep-static-consts -fgcse-sm -fgcse-las -fgcse-after-reload -floop-optimize2 -fsched2-use-superblocks -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-vectorize -ftracer -fsplit-ivs-in-unroller -fvariable-expansion-in-unroller -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../gcc-4.1.2/gcc -I../../gcc-4.1.2/gcc/. -I../../gcc-4.1.2/gcc/../include -I../../gcc-4.1.2/gcc/../libcpp/include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer \ -c ../../gcc-4.1.2/gcc/crtstuff.c -DCRT_BEGIN \ -o crtbegin.o ... All flags are now being used but also a "-O2 -O2" shows up. That is no problem at all but could get cleaned out anyway. Next, again libcpp but during the first stage: ... make[3]: Entering directory `/home/sven/obj/stageprofile-libcpp' /home/sven/obj/./prev-gcc/xgcc -B/home/sven/obj/./prev-gcc/ -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -I../../gcc-4.1.2/libcpp -I. -I../../gcc-4.1.2/libcpp/../include -I../../gcc-4.1.2/libcpp/include -O2 -g -fomit-frame-pointer -fprofile-generate -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Werror -I../../gcc-4.1.2/libcpp -I. -I../../gcc-4.1.2/libcpp/../include -I../../gcc-4.1.2/libcpp/include -c -o charset.o -MT charset.o -MD -MP -MF .deps/charset.Po ../../gcc-4.1.2/libcpp/charset.c ... Now there is a "-O2 -g -fomit-frame-pointer" but again none of my flags. In any case that should be identical to the first build of libcpp, shouldn't it? Next is another build of libgcc: ... /home/sven/obj/./gcc/xgcc -B/home/sven/obj/./gcc/ -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -B/home/sven/gnu/i686-pc-linux-gnu/lib/ -isystem /home/sven/gnu/i686-pc-linux-gnu/include -isystem /home/sven/gnu/i686-pc-linux-gnu/sys-include -O2 -O2 -pipe -march=athlon-xp -msse -mmmx -m3dnow -mfpmath=sse -O3 -mpreferred-stack-boundary=6 -falign-functions=64 -falign-jumps=64 -fomit-frame-pointer -fforce-addr -fno-keep-static-consts -fgcse-sm -fgcse-las -fgcse-after-reload -floop-optimize2 -fsched2-use-superblocks -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-vectorize -ftracer -fsplit-ivs-in-unroller -fvariable-expansion-in-unroller -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../gcc-4.1.2/gcc -I../../gcc-4.1.2/gcc/. -I../../gcc-4.1.2/gcc/../include -I../../gcc-4.1.2/gcc/../libcpp/include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer \ -c ../../gcc-4.1.2/gcc/crtstuff.c -DCRT_BEGIN \ -o crtbegin.o ... This again includes a "-O2 -O2". The first time it appears to be working the way I think it should is here: ... make[3]: Entering directory `/home/sven/obj/stagefeedback-libiberty' if [ x"" != x ] && [ ! -d pic ]; then \ mkdir pic; \ else true; fi touch stamp-picdir if [ x"" != x ]; then \ /home/sven/obj/./prev-gcc/xgcc -B/home/sven/obj/./prev-gcc/ -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -c -DHAVE_CONFIG_H -pipe -march=athlon-xp -msse -mmmx -m3dnow -mfpmath=sse -O3 -mpreferred-stack-boundary=6 -falign-functions=64 -falign-jumps=64 -fomit-frame-pointer -fforce-addr -fno-keep-static-consts -fgcse-sm -fgcse-las -fgcse-after-reload -floop-optimize2 -fsched2-use-superblocks -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-vectorize -ftracer -fsplit-ivs-in-unroller -fvariable-expansion-in-unroller -freorder-blocks-and-partition -I. -I../../gcc-4.1.2/libiberty/../include -W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes ../../gcc-4.1.2/libiberty/regex.c -o pic/regex.o; \ else true; fi ... All flags are being used without conflicting or clobbering with other flags. Next is another libcpp build: ... make[3]: Entering directory `/home/sven/obj/stagefeedback-libcpp' /home/sven/obj/./prev-gcc/xgcc -B/home/sven/obj/./prev-gcc/ -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -I../../gcc-4.1.2/libcpp -I. -I../../gcc-4.1.2/libcpp/../include -I../../gcc-4.1.2/libcpp/include -O2 -g -fomit-frame-pointer -fprofile-use -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Werror -I../../gcc-4.1.2/libcpp -I. -I../../gcc-4.1.2/libcpp/../include -I../../gcc-4.1.2/libcpp/include -c -o charset.o -MT charset.o -MD -MP -MF .deps/charset.Po ../../gcc-4.1.2/libcpp/charset.c ... Again a "-O2 -g -fomit-frame-pointer" which was not been given to make but must be coming from the Makefiles themselves appears. Same happens when the profiles are being used: ... /home/sven/obj/./prev-gcc/xgcc -B/home/sven/obj/./prev-gcc/ -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -c -O2 -g -fomit-frame-pointer -fprofile-use -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -Werror -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gcc-4.1.2/gcc -I../../gcc-4.1.2/gcc/build -I../../gcc-4.1.2/gcc/../include -I../../gcc-4.1.2/gcc/../libcpp/include -o build/genmodes.o ../../gcc-4.1.2/gcc/genmodes.c ... It continues with: ... /home/sven/obj/./gcc/xgcc -shared-libgcc -B/home/sven/obj/./gcc -nostdinc++ -L/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/src -L/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/src/.libs -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -B/home/sven/gnu/i686-pc-linux-gnu/lib/ -isystem /home/sven/gnu/i686-pc-linux-gnu/include -isystem /home/sven/gnu/i686-pc-linux-gnu/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -pipe -march=athlon-xp -msse -mmmx -m3dnow -mfpmath=sse -O3 -mpreferred-stack-boundary=6 -falign-functions=64 -falign-jumps=64 -fomit-frame-pointer -fforce-addr -fno-keep-static-consts -fgcse-sm -fgcse-las -fgcse-after-reload -floop-optimize2 -fsched2-use-superblocks -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-vectorize -ftracer -fsplit-ivs-in-unroller -fvariable-expansion-in-unroller -freorder-blocks-and-partition -D_GNU_SOURCE -I/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu -I/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/include -I/home/sven/gcc-4.1.2/libstdc++-v3/libsupc++ /home/sven/gcc-4.1.2/libstdc++-v3/include/stdc++.h -O0 -g -o ./i686-pc-linux-gnu/bits/stdc++.h.gch/O0g.gch; \ ... Here all my flags are being used and then get clobbered by a -O0. Just one line after this I get: /home/sven/obj/./gcc/xgcc -shared-libgcc -B/home/sven/obj/./gcc -nostdinc++ -L/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/src -L/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/src/.libs -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -B/home/sven/gnu/i686-pc-linux-gnu/lib/ -isystem /home/sven/gnu/i686-pc-linux-gnu/include -isystem /home/sven/gnu/i686-pc-linux-gnu/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -pipe -march=athlon-xp -msse -mmmx -m3dnow -mfpmath=sse -O3 -mpreferred-stack-boundary=6 -falign-functions=64 -falign-jumps=64 -fomit-frame-pointer -fforce-addr -fno-keep-static-consts -fgcse-sm -fgcse-las -fgcse-after-reload -floop-optimize2 -fsched2-use-superblocks -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-vectorize -ftracer -fsplit-ivs-in-unroller -fvariable-expansion-in-unroller -freorder-blocks-and-partition -D_GNU_SOURCE -I/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu -I/home/sven/obj/i686-pc-linux-gnu/libstdc++-v3/include -I/home/sven/gcc-4.1.2/libstdc++-v3/libsupc++ /home/sven/gcc-4.1.2/libstdc++-v3/include/stdc++.h -O2 -g -o ./i686-pc-linux-gnu/bits/stdc++.h.gch/O2g.gch; ... Here it is a "-O2" which clobbers my flags. Another interesting case is then: ... make[4]: Entering directory `/home/sven/obj/i686-pc-linux-gnu/libmudflap' if /bin/sh ./libtool --mode=compile /home/sven/obj/./gcc/xgcc -B/home/sven/obj/./gcc/ -B/home/sven/gnu/i686-pc-linux-gnu/bin/ -B/home/sven/gnu/i686-pc-linux-gnu/lib/ -isystem /home/sven/gnu/i686-pc-linux-gnu/include -isystem /home/sven/gnu/i686-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.1.2/libmudflap -I. -Wall -ffunction-sections -fdata-sections -O2 -pipe -march=athlon-xp -msse -mmmx -m3dnow -mfpmath=sse -O3 -mpreferred-stack-boundary=6 -falign-functions=64 -falign-jumps=64 -fomit-frame-pointer -fforce-addr -fno-keep-static-consts -fgcse-sm -fgcse-las -fgcse-after-reload -floop-optimize2 -fsched2-use-superblocks -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-vectorize -ftracer -fsplit-ivs-in-unroller -fvariable-expansion-in-unroller -freorder-blocks-and-partition -MT mf-runtime.lo -MD -MP -MF ".deps/mf-runtime.Tpo" -c -o mf-runtime.lo ../../../gcc-4.1.2/libmudflap/mf-runtime.c; \ then mv -f ".deps/mf-runtime.Tpo" ".deps/mf-runtime.Plo"; else rm -f ".deps/mf-runtime.Tpo"; exit 1; fi ... Here the compiler gets "-ffunction-sections -fdata-sections -O2" prepended. AFAIK the first two flags currently only make sense on Suns where the linker can actually use that information (according to the manpage). So why do I see them on my i686-pc-linux box? At the end it however has build its executables and I can do a "make install" and it will all get installed. It just does not make alot of sense this way. What arguments can I pass and why are they not always being used? This was now just for "profiledbootstrap" and I believe it is just as strange when doing a normal bootstrap. I also sometimes see messages like: file gcov.gcda not found, execution counts estimated Some compiles with "-fprofile-use" cannot find their profile. Might be just normal but should it be like that? Either "-fprofile-use" should not be used at all in these cases or it is a bug or the profile got lost somehow. Btw, I have set the severity of this report to "trivial" but now found that it got set to "normal". I do not mind you raising the severity but I do get a working compiler in the end. Please do not let this stand in your way folks, I still think it is trivial. Sorry when I've got nothing really severe for you *snicker*. Sven -- sdack at gmx dot de changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |trivial http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30810