11.2. Optimization Levels

Table 11-1 shows the basic optimization levels that are included in many compilers and indicates how they are invoked:.

Table 11-1. Compiler Optimization Levels
LevelDescriptionCommand Line OptionC DirectiveFortran Directive
0Very little optimization.PA-RISC: the default, so no flag needed IPF: +O0#pragma opt_level 0 #pragma optimize off$Optimize off
1Local optimization within block boundaries only.PA-RISC: +O1 IPF: the default, so no flag needed#pragma opt_level 1$Optimize level 1 on
2Global optimization within procedures only.-O or +O2#pragma opt_level 2$Optimize level 2 on
3Full optimization across all procedures within a single file.+O3#pragma opt_level 3$Optimize level 3 on
4Full optimization across the entire application ...

Get HP-UX 11i Tuning and Performance now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.