HP C Programmer's Guide (92434-90009)

Chapter 4 83
Optimizing HP C Programs
Controlling Specific Optimizer Features
+O[no]volatile
Optimization level(s): 1, 2, 3, 4
Default: +Onovolatile
The +Ovolatile option implies that memory references to global variables cannot be
removed during optimization.
The +Onovolatile option implies that all globals are not of volatile class. This means
that references to global variables can be removed during optimization.
The +Ovolatile option replaces the obsolete +OV option.
Use this option to control the volatile semantics for all global variables.
+O[no]whole_program_mode
Optimization level(s): 4
Default: +Onowhole_program_mode
The +Owhole_program_mode option enables the assertion that only the files that are
compiled with this option directly reference any global variables and procedures that are
defined in these files. In other words, this option asserts that there are no unseen accesses
to the globals.
When this assertion is in effect, the optimizer can hold global variables in registers longer
and delete inlined or cloned global procedures.
All files compiled with +Owhole_program_mode must also be compiled with +O4. If any of
the files were compiled with +O4 but were not compiled with +Owhole_program_mode, the
linker disables the assertion for all files in the program.
The default, +Onowhole_program_mode, disables the assertion.
Use this option to increase performance speed, but only when you are certain that only the
files compiled with +Owhole_program_mode directly access any globals that are defined in
these files.