HP C Programmer's Guide (92434-90009)

Chapter 4 65
Optimizing HP C Programs
Removing Compilation Time Limits When Optimizing
Aggressive optimizations are new optimizations or are optimizations that can change the
behavior of programs. These optimizations may do any of the following:
convert certain library calls to millicode and inline instructions
cause the inlined routines strcpy(), sqrt(), fabs(), and alloca() to not return the
routine's completion status in ERRNO
alter exception handling and asynchronous interrupt handling as a result of instruction
scheduling optimization
cause less precise floating-point results
cause programs that perform comparisons between pointers to shared memory and
pointers to private memory to run incorrectly
Use aggressive optimizations with stable, well-structured, ANSI-conforming code. These
types of optimizations give you faster code, but are riskier than the default optimizations.
Removing Compilation Time Limits When Optimizing
You can remove optimization time restrictions at the second, third, or fourth optimization
levels by using the +Onolimit option as follows:
cc +O2 +Onolimit
sourcefile
.c
or:
cc +O3 +Onolimit
sourcefile
.c
or:
cc +O4 +Onolimit
sourcefile
.c
By default, the optimizer limits the amount of time spent optimizing large programs at
levels 2, 3, and 4. Use this option if longer compile times are acceptable because you want
additional optimizations to be performed.
Limiting the Size of Optimized Code
You can disable optimizations that expand code size at the second, third, and fourth
optimization levels by using the +Osize suboption, as follows:
cc +O2 +Osize
sourcefile
.c
or:
cc +O3 +Osize
sourcefile
.c
or: