This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimizations and gcc

> I've been testing various combinations of options with gcc 3.0.4.
> The documentation is, to me, misleading. For example, it states that
> "`-O2' turns on all optional optimizations except for loop unrolling,
> function inlining, and register renaming."
> and
> "`-O3' turns on all optimizations specified by `-O2' and also turns on the
> `-finline-functions' and `-frename-registers' options."
> The above is not entirely correct, and it certainly leaves out important
> detail. Which specific options *do* -O2 and -O3 enable? When -O2 states
> "all... except for", I assume it is beging very specific -- and it isn't!
> For example: Does -O2 imply the -fomit-frame-pointer option? If I take the
> wording at face value -O2 *should* imply -fomit-frame-pointer -- yet, when I
> compile code with "-O2", it is slower than code compiled with
> "-O2 -fomit-frame-pointer".

I need, this is confusing.  I think there used to be full list, but somehow
it is not there anymore.  There are few notable exceptions of optimizations
not enabled - like loop unrolling and the experimental stuff - SSA.

I think it is mentioned in the documentations of particular options
(like -ffast-math mentions it can not be enabled by default on some level),
but it is nout really enought.  I would suggest to explicitly mention for
each optimization option at what level it is enabled. This can be easier to
maintain than the pure list.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]