この答えはおそらく遠すぎて遅すぎると思いますが、積極的な最適化のためには、「-fast」オプションが最も簡単な解決策のようです。manページからの抜粋:
-fast
Maximizes speed across the entire program.
Description:
This option maximizes speed across the entire program.
It sets the following options:
- On Linux* systems: -ipo, -O3, -no-prec-div, -static, and -xHost
- On OS X* systems: -ipo, -mdynamic-no-pic, -O3, -no-prec-div, and -xHost
- On Windows* systems: /O3, /Qipo, /Qprec-div-, and /QxHost
NOTE: Option fast sets some aggressive optimizations that may not be appropriate for all
applications. The resulting executable may not run on processor types different from the
one on which you compile. You should make sure that you understand the individual optimi-
zation options that are enabled by option fast.