-ipo

The -ipooption enables interprocedural optimizations across files. The object file produced using this option contains intermediate code (IELF file). At link time,ld automatically invokes the interprocedural optimizer (u2comp), if any of the input object files is an IELF file.

For optimization levels +O0 and +O1, this option is silently ignored.

The-ipooption will get implicitly invoked with the +O4 and +Ofaster options to match current behavior (+O4 ==> +O3 -ipo).

For -ipocompilations, the back end is parallelized, and the level of parallelism can be controlled with the environment variable PARALLEL, since the standard HP-UX make utility is used for the parallelization.

Object Files Generated with -ipo

Object files generated by the compiler with +O4 or -ipo, called intermediate object files, are intended to be temporary files. These object files contain an intermediate representation of the user code in a format that is designed for advanced optimizations. The size of these intermediate object files can typically be 3 to 10 times as large as normal object files. Hewlett-Packard reserves the right to change the format of these files without prior notice. There is no guarantee that intermediate object files will be compatible from one revision of the compiler to the next. Use of intermediate files must be limited to the compiler that created them. For the same reason, intermediate object files should not be included into archived libraries that might be used by different versions of the compiler. The compiler will issue an error message and terminate when an incompatible intermediate file is generated.

+[no]nrv

+[no]nrv

-nrv_optimization,[offon]

The +[no]nrv option enables [disables] the named return value (NRV) optimization. By default it is disabled.

The NRV optimization eliminates a copy-constructor call by allocating a local object of a function directly in the caller’s context if that object is always returned by the function.

Example:

struct A{

A(A const&); //copy-constructor };

A f(A constA x) { A a(x);

return a; // Will not call the copy constructor if the

}// optimization is enabled.

This optimization will not be performed if the copy-constructor was not declared by the programmer. Note that although this optimization is allowed by the ISO/ANSI C++ standard, it may have noticeable side effects.

Example:

aCC -Wc,-nrv_optimization,on app.C

+O[no]failsafe

+O[no]failsafe

The +O[no]failsafe option enables [disables] failsafe optimization. When a compilation fails at the current optimization level +Ofailsafe will automatically restart the compilation at +O2 (for specific high level optimizer errors +O3/+O4), O1, or +O0.

The default is +Ofailsafe.

56 Command-Line Options