HPlogo HP C/HP-UX Programmer's Guide: HP 9000 Computers > Chapter 4 Optimizing HP C Programs

Enabling Aggressive Optimizations

» 

Technical documentation

Complete book in PDF

 » Table of Contents

To enable aggressive optimizations at the second, third, or fourth optimization levels, use the +Oaggressive option as follows:

cc
+O2 +Oaggressive sourcefile.c

or:

cc
+O3 +Oaggressive sourcefile.c

or:

cc
+O4 +Oaggressive sourcefile.c

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 stack unwind-based 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.

© Hewlett-Packard Development Company, L.P.