By default, the compiler performs only quick local optimizations such as constant folding and elimination of local common sub-expressions, while still allowing full debugging support. You can optimize your program by specifying various optimization levels, which provide increasing application performance, at the expense of larger program size, longer compilation time, and diminished debugging support. The options you can specify are summarized in the following table, and more detailed descriptions of the techniques used at each optimization level are provided below.
Option | Behavior |
---|---|
-O or -O2 or -qoptimize or -qoptimize=2 | Comprehensive low-level optimization; partial debugging support. |
-O3 or -qoptimize=3 | More extensive optimization; some loop optimization; some precision trade-offs. |
-O4 or -qoptimize=4 | Interprocedural optimization; comprehensive loop optimization; automatic machine tuning. |
-O5 or -qoptimize=5 |