HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)

Additional Options for Finer Control
In addition to basic optimization levels, optimization options are provided should you
require a more precise level of control.
Some introductory examples follow:
Enabling Aggressive Optimizations
To enable aggressive optimizations at the second, third, or fourth optimization levels,
use the +Ofast option as follows:
aCC +Ofast +O2 sourcefile.C
or:
aCC +Ofast +O3 sourcefile.C
or:
aCC +Ofast +O4 sourcefile.C
This option enables additional optimizations at each level.
NOTE: Use aggressive optimizations with stable, well-structured code. These types of
optimizations give you faster code, but may change the behavior of programs.
These optimizations may do any of the following:
Relocate conditional floating-point instructions from within loops
Convert certain library calls to millicode and inline instructions
Alter error-handling requirements
Enabling Only Conservative Optimizations
You can enable only conservative optimizations at the second, third, or fourth optimization
levels by using the +Ofltacc=strict +Ofenvaccess option, as follows:
aCC +O2 +Ofltacc=strict +Ofenvaccess sourcefile.C
or:
aCC +O3 +Ofltacc=strict +Ofenvaccess sourcefile.C
or:
aCC +O4 +Ofltacc=strict +Ofenvaccess sourcefile.C
This option disables all but the most conservative optimizations at each level. Conservative
optimizations do not change the behavior of code, in most cases, even if the code does
not conform to standards.
Use only conservative optimizations provided with level 2, 3, and 4 when your code is
unstructured.
196 Optimizing HP aC++ Programs