5.6.3.3 Optimization

Table 5-6. Optimization Category
OptionDescriptionCommand Line
Optimization LevelSelect an optimization level. Your compiler edition may support only some optimizations. Equivalent to -On option, where n is an option below:

0 - Do not optimize. The compiler’s goal is to reduce the cost of compilation and to make debugging produce the expected results.

1 - Optimize. Optimizing compilation takes somewhat longer and a lot more host memory for a large function. The compiler tries to reduce code size and execution time.

2 - Optimize even more. The compiler performs nearly all supported optimizations that do not involve a space-speed trade-off.

3 - Optimize yet more favoring speed (superset of O2).

s - Optimize yet more favoring size (superset of O2).

-o0 -o1,-o -o2 -o3 -os
Unroll loopsThis option often increases execution speed at the expense of larger code size.

Check to perform the optimization of loop unrolling. This is only done for loops whose number of iterations can be determined at compile time or run time.

Uncheck to not unroll loops.

6.6.6.6.23 -funroll-loops
Omit frame pointerCheck to not keep the Frame Pointer in a register for functions that don’t need one.

Uncheck to keep the Frame Pointer.

6.6.6.7.7 -fomit-frame-pointer
Unlimited procedural abstractionEnable the procedure abstraction optimization. There is no limit on the nesting level.-mpa
Procedural abstraction levelEnable the procedure abstraction optimization up to level n.
  • 0 - Optimization is disabled.
  • 1 - The first level of abstraction is allowed; that is, instruction sequences in the source code may be abstracted into a subroutine.
  • 2 or greater - A second level of abstraction is allowed; that is, instructions that were put into a subroutine in the first level may be abstracted into a subroutine one level deeper. This pattern continues for larger values of n. The net effect is to limit the subroutine call nesting depth to a maximum of n.
-mpa=n
Pre-optimization instruction schedulingDefault for optimization level:

- Disable

- Enable

-f[no-]schedule-insns
Post-optimization instruction schedulingDefault for optimization level:

- Disable

- Enable

-f[no-]schedule-insns2