On 04/12/2012 04:23 PM, Gabriel Dos Reis wrote: > because -Os says it optimizes for size, the expectation is clear. > -O3 does not necessarily give better optimization than -O2.
No, but it does mean that GCC turns on more optimization options. "Optimize yet more. -O3 turns on all optimizations specified by -O2 and also turns on the -finline-functions, -funswitch-loops, -fpredictive-commoning, -fgcse-after-reload, -ftree-vectorize and -fipa-cp-clone options. " Just like -W3 wouldn't necessarily generate more warnings on your code than -W1, perhaps because your code is already "clean" enough. It would simply be documented as: "-W3: Warn yet more. -W3 turns on all warnings specified by -W2 and also ...". I'll also note the parallel with -glevel, not just -O. So, 'gcc -glevel -Wlevel -Olevel' feels quite natural to me. -- Pedro Alves