Hello, On Sun, 27 Apr 2014 07:23:11 -0400 Rich Freeman wrote: > And yet, in the same paragraph you mention -O3, which is > tantamount to just setting a flag and walking away. That turns > on 14 things you probably don't really need.
Why 14 things? According to gcc-4.8.2 manual -O3 enables the following: -finline-functions, -funswitch-loops, -fpredictive-commoning, -fgcse-after-reload, -ftree-vectorize, -fvect-cost-model, -ftree-partial-pre, -fipa-cp-clone. Some of this options triggers another ones, but these 8 things are sufficient to mimic -O3 completely. >From my experience only three of them are harmful: -finline-functions and -fipa-cp-clone bloat code size significantly hurting performance due to more CPU cache misses. -ftree-vectorize may be used on amd64 (performance boost is in the range -3.. +5%), but is a complete menace on x86: a lot of ICEs and a lot of segfaults due to stack misalignment and even some working but miscompiled code. While some (but not all) stack alignment issues may be fixed with -mstackrealign, this drops performance enhancement to negative values. All other -O3 option have either no effect or measurable performance enhancements in the range of several percent. Tests were made using multimedia packages (mplayer, ffmpeg, x264) and scientific ones (root, pythia, geant, blas libs). Best regards, Andrew Savchenko
pgpOZXUkl0C_P.pgp
Description: PGP signature
