Setting Optimization Level

See the Options to Optimize Different Application Types section for more information.

Option

Description

Default

-O1

IA-32 compiler: Optimizes for speed.  Disables -fp option.

ItaniumŪ compiler: Turns off software pipelining to reduce code size. Optimizes to favor code size. Enables the same optimizations as -O2 except for loop unrolling.
Generally, -O2 is recommended over -O1.

OFF

-O, -O2

Optimizes for speed. Disables -fp. option.

-O2

-O3
 

Enables -O2 option with more aggressive optimization and sets high-level optimizations, including loop transformation, OpenMP, and prefetching. High-level optimizations use the properties of source code constructs such as loops and arrays in applications written in high-level programming languages.
Optimizes for maximum speed, but may not improve performance for some programs.

OFF

-O0

Disables optimizations -O1, -O2 and -O3. Enables option -fp.

OFF