HP aC++/HP C A.06.20 Programmer's Guide

NOTE: The +Ovolatile option is not recommended. Instead, use the C/C++ Standard
volatile qualifiers.
+O[no]whole_program_mode
+O[no]whole_program_mode
The +O[no]whole_program option enables the assertion that only those 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. This option is in effect only at
+O4 level of optimization.
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 is +Onowhole_program_mode which 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.
Profile-Based Optimization Options
Profile-based optimization is a set of performance-improving code transformations
based on the runtime characteristics of your application.
+Oprofile
+Oprofile=[use|collect]
The +Oprofile option instructs the compiler to instrument the object code for collecting
runtime profile data. The profiling information can then be used by the linker to perform
profile-based optimization. When an application finishes execution, it will write profile
data to the fileflow.data or to the file/path in the environment variable FLOW_DATA
(if set).
+Oprofile=use[:filename] causes the compiler to look for a profile database file.
If a filename is not specified, the compiler will look for a file named "flow.data" or the
file/path specified in the FLOW_DATA environment variable. If a filename is specified,
it overrides the FLOW_DATA environment variable.
After compiling and linking with +Oprofile=collect, run the resultant program
using representative input data to collect execution profile data. Profile data is stored
in flow.data by default. The name is generated as flow.<suffix> if there is already
a flow.datafile present in the current directory. Finally, recompile with the
Code Optimizing Options 85