HPlogo HP C/HP-UX Programmer's Guide: Workstations and Servers > Chapter 4 Optimizing HP C Programs

Enabling Aggressive Optimizations

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

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 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.