http://www.network-theory.co.uk/docs/gccintro/gccintro_49.html
Citat:
This option turns on further optimizations, in addition to those
used by ‘-O1’. These additional optimizations include instruction
scheduling. Only optimizations that do not require any speed-space
tradeoffs are used, so the executable should not increase in size. The
compiler will take longer to compile programs and require more
memory than with ‘-O1’. This option is generally the best choice
for deployment of a program, because it provides maximum optimization
without increasing the executable size. It is the default
optimization level for releases of GNU packages.
http://www.network-theory.co.uk/docs/gccintro/gccintro_50.html
Citat:
Note that for a small program such as this there can be considerable variation between systems and compiler versions. For example, on a Mobile 2.0GHz Intel Pentium 4M system the trend of the results using the same version of GCC is similar except that the performance with -O2 is slightly worse than with -O1. This illustrates an important point: optimizations may not necessarily make a program faster in every case.