+O2
or -O | Level 1 optimizations, plus optimizations
performed over entire functions in a single file. Optimizes loops
in order to reduce pipeline stalls. Performs scalar replacement,
and analysis of data-flow, memory usage, loops and expressions. | Can produce faster run-time code than
level 1 if programs use loops extensively. Compiles faster than
level 3. Loop-oriented floating point intensive applications may
see run times reduced by 50%. Operating system and interactive
applications that use the already optimized system libraries can
achieve 30% to 50% additional improvement. |
+O3 | Level 2 optimizations, plus full optimization
across all subprograms within a single file. Includes subprogram
inlining. | Can produce faster run-time code than
level 2 on code that frequently calls small functions. Links faster
than level 4. |
+O4 | Level 3 optimizations, plus full optimizations
across the entire application program. Includes global and static
variable optimization and inlining across the entire program. Optimizations
are performed at link-time. | Produces faster run-time code than level
3 if programs use many global variables or if there are many opportunities
for inlining procedure calls. |