[Nottingham] Compiler optimisation flags (gcc, g++)

Robert Davies rob_davies at ntlworld.com
Mon Nov 3 17:57:08 GMT 2003


On Monday 03 Nov 2003 15:12, Martin wrote:
> Any pitfalls with using the following compiler optimisations for an
> Athlon Palomino cpu system?

Theres' been a recent article in Gentoo news, comparing some optimisation 
flags.  One of the issues was -O3 slowing code down (due to bloat), if you 
want non-explicit function inlining then consider -finline-limit=N where N is 
some size smaller than the default.  Altering alignments from defaults, also 
did not help, except if made much larger.

The problem with flags is, they are very processor and program specific, it's 
doubtful you get enough of a benefit over -O2 -march=athlon-xp (or -O3 with 
low -finline-limit) to warrant the effort, and noone else can tell you the 
'right' options to use for your software.

Things like -msse and -m3dnow are meant to be switched on by -march, anyway, 
if you check gcc in verbose mode, it actually seems to turn off these 
settings (gcc-3.{1,2,3}) immediately after you select them.

Rob




More information about the Nottingham mailing list