crypt of decay - с кем-то я там беседовал о максимальном числе после -O в gcc [entries|archive|friends|userinfo]
ketmar

[ userinfo | ljr userinfo ]
[ archive | journal archive ]

с кем-то я там беседовал о максимальном числе после -O в gcc [Oct. 21st, 2010|06:17 pm]
Previous Entry Add to Memories Tell A Friend Next Entry
из gcc-help@gcc.gnu.org:
> 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 ;-)
Linkmeow!

Comments:
From:(Anonymous)
Date:October 21st, 2010 - 05:35 pm
(Link)
красота.
From:[info]phantom
Date:October 21st, 2010 - 09:15 pm
(Link)
О, я когда генту собирал, думал, почему же я компилирую с -О3, а не большим. А большего и нет, оказывается. Значит, я всё круто компилировал.