Re: About -On optimization flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey Jose,
Using the -On optimization flag, what is the greatest "n" value that
can I use? In the gcc manual (4.5.1, 4.4.5, 3.4.6) the greatest level
documented is -O3
(http://gcc.gnu.org/onlinedocs/gcc-4.5.1/gcc/Optimize-Options.html#Optimize-Options),
but if you tray for example with -O4, -O5, -O9, etc. no warning nor
error is emitted.
From the source code, you could use a number up to 255 (all numbers greater than 255 are cut to 255). But currently, whatever number greater than 3 you use, you'll only get -O3 optimization, though the documentation is correct.

What is the correct answer? Is -O3 the higher optimization level as is
documented in the manual or -O4, -O5 performs additional
optimizations?
I can't find any indications in the source code that -O4, ... has any real additional effect than -O3
If -O3 is the higher why the use of -O4, -O5 not emits
a warning or error?
I don't know the real reason for this implementation, unfortunately, but my guess is that it was implemented to simplify the extension of new opt levels, but yes, a warning could be added ;-)

Hope that helps,
Andi


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux