View previous topic :: View next topic |
Author |
Message |
mrfree Veteran
Joined: 15 Mar 2003 Posts: 1303 Location: Europe.Italy.Sulmona
|
Posted: Mon Dec 20, 2004 8:44 am Post subject: Extreme CFLAGS problems... |
|
|
Using acovea benchmark I obtain (before 2 days) this results:
Code: |
Score | So? | Switch (annotation)
------------------------------------------------------------------------------
34.0 | Maybe | -fforce-mem (-O2)
32.3 | Yes | -frename-registers (-O3)
32.1 | Yes | -funsafe-math-optimizations (fast math)
32.0 | Yes | -fcse-skip-blocks (-O2)
30.7 | Yes | -fdelete-null-pointer-checks (-O2)
29.6 | Yes | -fno-thread-jumps (! -O1)
29.5 | Yes | -fno-omit-frame-pointer (! -O1)
29.5 | Yes | -mieee-fp
29.3 | Maybe | -fno-math-errno (fast math)
28.2 | Maybe | -fstrict-aliasing (-O2)
27.9 | Maybe | -frerun-cse-after-loop (-O2)
27.8 | Yes | -finline-limit
27.7 | Yes | -mno-push-args
27.1 | Yes | -fno-signaling-nans (fast math)
26.9 | Yes | -falign-jumps (-O2 GCC 3.3)
26.6 | Yes | -malign-double
26.5 | Yes | -fno-defer-pop (! -O1)
26.3 | Maybe | -ffinite-math-only (fast math)
26.2 | Yes | -fsched-interblock (-O2 GCC 3.3)
25.5 | Maybe | -fno-trapping-math (fast math)
25.3 | Yes | -fno-cprop-registers (! -O1)
25.3 | No | -fgcse (-O2)
24.4 | Maybe | -fno-crossjumping (! -O1)
24.4 | Yes | -fcaller-saves (-O2)
24.3 | Maybe | -mno-align-stringops
23.5 | Maybe | -falign-loops (-O2 GCC 3.3)
23.4 | Yes | -maccumulate-outgoing-args
23.4 | Yes | -fno-if-conversion2 (! -O1)
23.4 | Maybe | -fno-merge-constants (! -O1)
23.0 | Maybe | -fno-delayed-branch (! -O1)
22.9 | Maybe | -fcse-follow-jumps (-O2)
22.8 | Maybe | -freorder-functions (-O2 GCC 3.3)
22.8 | Maybe | -freduce-all-givs
22.8 | Maybe | -fpeephole2 (-O2)
22.5 | Yes | -fsched-spec (-O2 GCC 3.3)
22.4 | Maybe | -fmove-all-movables
21.7 | Maybe | -falign-labels (-O2 GCC 3.3)
21.2 | Maybe | -minline-all-stringops
21.0 | Maybe | -fschedule-insns2 (-O2)
19.3 | No | -fexpensive-optimizations (-O2)
18.9 | Maybe | -ftracer
18.2 | No | -finline-functions (-O3)
18.1 | Maybe | -frerun-loop-opt (-O2)
16.9 | No | -foptimize-sibling-calls (-O2)
16.8 | No | -fno-guess-branch-probability (! -O1)
16.4 | Maybe | -freorder-blocks (-O2)
15.9 | No | -fno-if-conversion (! -O1)
15.1 | Maybe | -fstrength-reduce (-O2)
14.1 | No | -fregmove (-O2)
14.1 | No | -fomit-frame-pointer
14.1 | No | -fschedule-insns (-O2)
13.8 | No | -fprefetch-loop-arrays
12.9 | No | -fno-inline
9.3 | No | -funroll-loops
8.9 | No | -fno-loop-optimize (! -O1)
7.8 | No | -ffloat-store
7.6 | No | -fnew-ra
0.0 | No | -funroll-all-loops
0.0 | No | -mfpmath=387
0.0 | No | -mfpmath=sse
0.0 | No | -mfpmath=sse,387
0.0 | No | -momit-leaf-frame-pointer |
I extract from this my new CLAGS using this strategy (using -O2 default optimization level):
.) If the considered flag marked with Yes and it isn't in O2 opt set => I add it to my CFLAGS
.) If the considered flag marked with Yes and it's in O2 opt set => I don't add it to my CLAGS
.) If the considered flag marked with No and it's in O2 opt set => I add it to my CFLAGS with no- prefix
.) If the considered flag marked with No and it isn't in O2 opt set => I ignore it
This is the result (I've a Pentium 4-M)...
Code: | CFLAGS="-march=pentium4 -mcpu=pentium4 -pipe -O2 -frename-registers -fno-thread-jumps -fno-omit-frame-pointer \
-mieee-fp -finline-limit=600 -mno-push-args -fno-signaling-nans -malign-double -fno-defer-pop -fno-cprop-registers \
-maccumulate-outgoing-args -fno-if-conversion2 -fno-gcse -fno-expensive-optimizations -fno-optimize-sibling-calls \
-fno-regmove -fno-schedule-insns" |
Using this CFLAGS set I try to upgrade my gnome... now gnome doesn't work
Which flag/s I can try to remove???
There is a test to try a new CFLAGS set without recomplile an important package??? _________________ Please EU, pimp my country!
ICE: /etc/init.d/iptables panic |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Mon Dec 20, 2004 8:55 am Post subject: Re: Extreme CFLAGS problems... |
|
|
mrfree wrote: | Using acovea benchmark I obtain (before 2 days) this
Code: | CFLAGS="-march=pentium4 -mcpu=pentium4 -pipe -O2 -frename-registers -fno-thread-jumps -fno-omit-frame-pointer \
-mieee-fp -finline-limit=600 -mno-push-args -fno-signaling-nans -malign-double -fno-defer-pop -fno-cprop-registers \
-maccumulate-outgoing-args -fno-if-conversion2 -fno-gcse -fno-expensive-optimizations -fno-optimize-sibling-calls \
-fno-regmove -fno-schedule-insns" |
Using this CFLAGS set I try to upgrade my gnome... now gnome doesn't work
|
I am surprised you got that far...WAY to many flags. How stable is your system??? Yikes...
I would only use these:
Code: |
" CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
|
They are safe and your performance might drop by 0.5%
You can read more on the Wiki: http://gentoo-wiki.com/Safe_Cflags
I am sure someone here can tell you exactly why having most of those flags are bad, I just know they are If you really want to look at ways to increase performance, move to GCC 3.4. GTK apps FLY using GC 3.4 as does everything else...reall improvment. |
|
Back to top |
|
|
mrfree Veteran
Joined: 15 Mar 2003 Posts: 1303 Location: Europe.Italy.Sulmona
|
Posted: Mon Dec 20, 2004 9:02 am Post subject: |
|
|
Quote: | I would only use these:
Code: | CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer" |
They are safe and your performance might drop by 0.5% |
I know but ... Hey I want that +0.5%
My entire system was compiled with
Code: | CFLAGS="-march=pentium4 -Os -pipe -fforce-addr -fomit-frame-pointer" |
But now I'm trying to boost my system performace
Quote: | to increase performance, move to GCC 3.4. GTK apps FLY using GC 3.4 as does everything else...reall improvment. |
Ok I'll try this too. _________________ Please EU, pimp my country!
ICE: /etc/init.d/iptables panic |
|
Back to top |
|
|
fca Guru
Joined: 22 Feb 2003 Posts: 346 Location: Netherlands
|
Posted: Mon Dec 20, 2004 9:36 am Post subject: |
|
|
-malign-double will break your system. That is the most "dangerous" option you've got there, if you mean by dangerous that it is documented broken. |
|
Back to top |
|
|
mrfree Veteran
Joined: 15 Mar 2003 Posts: 1303 Location: Europe.Italy.Sulmona
|
Posted: Mon Dec 20, 2004 10:11 am Post subject: |
|
|
Quote: | -malign-double will break your system |
Doh!!!
I've seen this making some experiment compiling gdm
Ok I'm trying to recompile all packages compiled with -maling-double... _________________ Please EU, pimp my country!
ICE: /etc/init.d/iptables panic |
|
Back to top |
|
|
mrfree Veteran
Joined: 15 Mar 2003 Posts: 1303 Location: Europe.Italy.Sulmona
|
Posted: Mon Dec 20, 2004 11:16 am Post subject: |
|
|
OK, now I'm compiling gcc 3.4.3
If I remove -mcpu flag, I can use this clags with gcc3.4??? _________________ Please EU, pimp my country!
ICE: /etc/init.d/iptables panic |
|
Back to top |
|
|
fca Guru
Joined: 22 Feb 2003 Posts: 346 Location: Netherlands
|
Posted: Mon Dec 20, 2004 4:05 pm Post subject: |
|
|
mrfree wrote: | OK, now I'm compiling gcc 3.4.3
If I remove -mcpu flag, I can use this clags with gcc3.4??? |
Of course, but if you're really after the performance (note: I think it alters only negligible after -march=pentium4 -O2 -fomit-frame-pointer -pipe) then run acovea again with gcc 3.4.3..
If you can stand the waiting and the compiling |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Mon Dec 20, 2004 4:26 pm Post subject: |
|
|
Ugh. I hope you're not intending to *ever* report any bugs or ask for help with broken packages... |
|
Back to top |
|
|
TheCoop Veteran
Joined: 15 Jun 2002 Posts: 1814 Location: Where you least expect it
|
Posted: Mon Dec 20, 2004 5:19 pm Post subject: |
|
|
well, my *flags are:
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer -ffast-math -fforce-addr -fprefetch-loop-arrays -ftracer"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
LDFLAGS="-Wl,-O1 -W1,--enable-new-dtags,--sort-common"
and i have never had any problems with packages not compiling properly. my system is rock solid. _________________ 95% of all computer errors occur between chair and keyboard (TM)
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler
Change the world - move a rock |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Mon Dec 20, 2004 5:27 pm Post subject: |
|
|
TheCoop wrote: | well, my *flags are:
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer -ffast-math -fforce-addr -fprefetch-loop-arrays -ftracer"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
LDFLAGS="-Wl,-O1 -W1,--enable-new-dtags,--sort-common"
and i have never had any problems with packages not compiling properly. my system is rock solid. |
No, your system is broken. At least one of the flags you have in there is guaranteed to produce broken code. |
|
Back to top |
|
|
TheCoop Veteran
Joined: 15 Jun 2002 Posts: 1814 Location: Where you least expect it
|
Posted: Mon Dec 20, 2004 5:37 pm Post subject: |
|
|
no, ny system is not broken. If it was broken then i would know about it by know
which flags produces broken code then? _________________ 95% of all computer errors occur between chair and keyboard (TM)
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler
Change the world - move a rock |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Mon Dec 20, 2004 5:43 pm Post subject: |
|
|
TheCoop wrote: | no, ny system is not broken. If it was broken then i would know about it by know
which flags produces broken code then? |
-ffast-math |
|
Back to top |
|
|
TheCoop Veteran
Joined: 15 Jun 2002 Posts: 1814 Location: Where you least expect it
|
Posted: Mon Dec 20, 2004 5:57 pm Post subject: |
|
|
oh i know about that, i dont use any programs which depend on exact spec. floating point math. If programs do start to produce wrong output ill just remove -ffast-math and recompile it. _________________ 95% of all computer errors occur between chair and keyboard (TM)
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler
Change the world - move a rock |
|
Back to top |
|
|
mrfree Veteran
Joined: 15 Mar 2003 Posts: 1303 Location: Europe.Italy.Sulmona
|
Posted: Mon Dec 20, 2004 6:13 pm Post subject: |
|
|
Quote: | Ugh. I hope you're not intending to *ever* report any bugs or ask for help with broken packages... |
Don't worry
If I notice some broken packages I'll know why
This is an xmas present for my notebook... a brand new CFLAGS set _________________ Please EU, pimp my country!
ICE: /etc/init.d/iptables panic |
|
Back to top |
|
|
valkyrite Apprentice
Joined: 19 Sep 2002 Posts: 241
|
Posted: Mon Dec 20, 2004 10:00 pm Post subject: |
|
|
Hey,
I am using the following settings in make.conf. Can I improve upon it. Should I add/delete any entries in CFLAGS section.
Code: |
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr -ffast-math -fno-exceptions -fexpensive-optimizations -mmmx -msse2 -s"
LDFLAGS="-s"
CXXFLAGS="${CFLAGS}"
|
BTW kmplayer on my system always crashes. |
|
Back to top |
|
|
WhyteWolf Apprentice
Joined: 01 May 2002 Posts: 168 Location: Las Vegas
|
Posted: Mon Dec 20, 2004 10:09 pm Post subject: |
|
|
Code: | CFLAGS="-march=pentium2 -O2" |
my flags suit me fine and never have I had a problem _________________ Thomas Phipps
Linux User #180408 LFS User #1791 |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Tue Dec 21, 2004 12:08 am Post subject: |
|
|
WhyteWolf wrote: | Code: | CFLAGS="-march=pentium2 -O2" |
my flags suit me fine and never have I had a problem |
hehe, Its going to be slow no matter what you set your CFLAGS too |
|
Back to top |
|
|
spb Retired Dev
Joined: 02 Jan 2004 Posts: 2135 Location: Cambridge, UK
|
Posted: Tue Dec 21, 2004 12:33 am Post subject: |
|
|
tiwaris wrote: | I am using the following settings in make.conf. Can I improve upon it. Should I add/delete any entries in CFLAGS section. | You can improve on it by dropping everything except -march, -O2, -fomit-frame-pointer and -pipe.
Quote: | BTW kmplayer on my system always crashes. | I'm not surprised. |
|
Back to top |
|
|
WhyteWolf Apprentice
Joined: 01 May 2002 Posts: 168 Location: Las Vegas
|
Posted: Tue Dec 21, 2004 12:55 am Post subject: |
|
|
Lokheed wrote: | WhyteWolf wrote: | Code: | CFLAGS="-march=pentium2 -O2" |
my flags suit me fine and never have I had a problem |
hehe, Its going to be slow no matter what you set your CFLAGS too | hehe ... beleave it or not the system is very responsive ... course ... ntpl and the new 2.6 kernel do help out a bit
along with keeping expensive libs out of my enviroemnt {no java ... no QT ... gtk+ without gnome} _________________ Thomas Phipps
Linux User #180408 LFS User #1791 |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Tue Dec 21, 2004 2:09 am Post subject: |
|
|
WhyteWolf wrote: | Lokheed wrote: | WhyteWolf wrote: | Code: | CFLAGS="-march=pentium2 -O2" |
my flags suit me fine and never have I had a problem |
hehe, Its going to be slow no matter what you set your CFLAGS too | hehe ... beleave it or not the system is very responsive ... course ... ntpl and the new 2.6 kernel do help out a bit
along with keeping expensive libs out of my enviroemnt {no java ... no QT ... gtk+ without gnome} |
I DO believe it. I have seen true P2 400's run faster and more responsive then 1.6 celerons. I have a PIII 933 and have beat celerons that clock over 2Ghz. Clock speed means nothing. The old PII and PIII were what put Intel on the map, and with good reason...
Its easy to get lost in the clock speed mode of thinking nowadays...uhh, but not to deviate from the topic to far
You guys with the 2 page CFLAGS are just causing yourself problems and headaches. I see a lot of redundent lines as well...all this shows you guys havent even researched or learned about CFLAGS. Listen to the devs on this one guys. I cant even fathom using a system like the ones you guys have as my core. Everything glitchy and broken...I guess that doesnt matter because your program opens up 0001 ms faster then mine
Have fun living in a world of constant recompiling. All that time spent recompiling certainly minuses the effects of that 0.5% increase though. How many times do you think you would have to run a program that opens up .001 ms faster when it took you an extra 6 hours to compile it
All this reminds me of the "Hating Gentoo Users" post. Ricers... |
|
Back to top |
|
|
truekaiser l33t
Joined: 05 Mar 2004 Posts: 801
|
Posted: Tue Dec 21, 2004 2:24 am Post subject: |
|
|
the only strange stuff i have in my make.conf is '-mmmx -msse' mainly cause i read that sometimes -mcpu=pentium4 doesn't pass those on. and i don't have -msse2 on cause it breaks some packages. |
|
Back to top |
|
|
ebrostig Bodhisattva
Joined: 20 Jul 2002 Posts: 3152 Location: Orlando, Fl
|
Posted: Tue Dec 21, 2004 2:45 am Post subject: |
|
|
It is always fun to see people mess around with CFLAGS when they have no idea what the various flags does nor why they actually set them or what the consequences are.
If you want to play around with cflags, do it in a chrooted environment and be prepared to do a lot of testing and to read the gcc-devel mailing list.
Besides, you may be able to shave off a 10th of a second here and there, but at the prize of stability and very, very, very untested binaries.
On my AMD64 machine I have been testing various flags, but it seems like I always come back to:
Code: |
-march=k8 -O3 -funroll-all-loops -fpeel-loops -ftracer -pipe
|
My system is rock solid.
Erik _________________ 'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.' |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Tue Dec 21, 2004 3:09 am Post subject: |
|
|
Lokheed wrote: | Everything glitchy and broken...I guess that doesnt matter because your program opens up 0001 ms faster then mine |
No no, all those fancy CFLAGS make the program open up *slower*, and task switch *slower*, but give slightly improved local performance.
ebrostig wrote: | -march=k8 -O3 -funroll-all-loops -fpeel-loops -ftracer -pipe
[/code] |
-funroll-all-loops produces slower, broken code. You're lucky we filter it in several places, it's known to really really break certain apps. |
|
Back to top |
|
|
WhyteWolf Apprentice
Joined: 01 May 2002 Posts: 168 Location: Las Vegas
|
Posted: Tue Dec 21, 2004 8:02 am Post subject: |
|
|
Lokheed wrote: | WhyteWolf wrote: | Lokheed wrote: |
hehe, Its going to be slow no matter what you set your CFLAGS too | hehe ... beleave it or not the system is very responsive ... course ... ntpl and the new 2.6 kernel do help out a bit
along with keeping expensive libs out of my enviroemnt {no java ... no QT ... gtk+ without gnome} |
I DO believe it. I have seen true P2 400's run faster and more responsive then 1.6 celerons. I have a PIII 933 and have beat celerons that clock over 2Ghz. Clock speed means nothing. The old PII and PIII were what put Intel on the map, and with good reason...
Its easy to get lost in the clock speed mode of thinking nowadays...uhh, but not to deviate from the topic to far |
hehe yeah ... course the fact the my little pent II is a Deschutes {the one with the low end cache of only 512Kb} does help matters
it ran rings around my girlfriends old laptop that was a 1.2 Ghz box
it was so diffrent going between them that I honestly thought her system was a celaron 1Ghz till I actualy READ the boot info course the fact my desktop has 256 megs of mem and her laptop only had 128 did make a big diffrence ... plus the fact she was useing XP i had either Gentoo or Win2K running ...
not bad for a system I paid a grand total of $10 for
Lokheed wrote: | You guys with the 2 page CFLAGS are just causing yourself problems and headaches. I see a lot of redundent lines as well...all this shows you guys havent even researched or learned about CFLAGS. Listen to the devs on this one guys. I cant even fathom using a system like the ones you guys have as my core. Everything glitchy and broken...I guess that doesnt matter because your program opens up 0001 ms faster then mine
Have fun living in a world of constant recompiling. All that time spent recompiling certainly minuses the effects of that 0.5% increase though. How many times do you think you would have to run a program that opens up .001 ms faster when it took you an extra 6 hours to compile it
All this reminds me of the "Hating Gentoo Users" post. Ricers... |
honestly I often hate the Gentoo Ricers ... my system performs plenty fast ... it might not be top of the line but it does what I need when I need it .. I'm not a gamer so I don't need ultra fast ... but I have a few tweaks in place to speed up handling where I need it ... and getting that extra 1% just isn't it ... use sane CFLAGS ... and use the USE luke Fat libs lead to more slow downs then anything a CFLAG can fix
if you have the high end number crunching ... go for those libs ... but don't complain if something breaks cause you put in insane CFLAGS to compensate
also ... as a side note ... I don't have java more out of a personal prefrence then an actual bloated lib problem _________________ Thomas Phipps
Linux User #180408 LFS User #1791 |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Tue Dec 21, 2004 10:14 pm Post subject: |
|
|
Just because you slap a "V-TECH" logo on the side of your PC, doesnt make it go any faster, hehehe. |
|
Back to top |
|
|
|