NOTE: Compiling with this optimization setting may require additional memory resources. Refer to the memory resource discussion above.

Example:

This command compiles prog.C and optimizes at level 3:

aCC +O3 prog.C

+O4

+O4

The +O4 option performs level 4 optimization. This includes level 3 optimizations plus full optimizations across the entire application program. Also, the defaults that depend on optimization will be the defaults for +O3.

When you link a program, the compiler brings all modules that were compiled at optimization level 4 into virtual memory at the same time. Depending on the size and number of the modules, compiling at +O4 can consume a large amount of virtual memory. If you are linking a large program that was compiled with the +O4 option, you may notice a system slow down. In the worst case, you may see an error indicating that you have run out of memory.

NOTE: Compiling with this optimization setting may require additional memory resources. Refer to the memory resource discussion above.

Example:

This command compiles prog.C and optimizes at level 4:

aCC +O4 prog.C

If you run out of memory when compiling at +O4 optimization, there are several things you can do:

Compile at +O4 only those modules that need to be compiled at optimization level 4, and compile the remaining modules at a lower level.

If you still run out of memory, increase the per-process data size limit. Run the System Administrator Manager (SAM) to increase the maxdsiz_64bit process parameter to more than 4GB. This procedure provides the process with additional data space.

If increasing the per-process data size limit does not solve the problem, increase the system swap space.

Refer to the System Administration Tasks manual for more information.

Object Files Generated at Optimization Level 4

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.

Additional Optimization Options for Finer Control

Following are the additional optimizations options for finer control:

Code Optimizing Options 55

Page 55
Image 55
HP C/aC++ for PA-RISC Software manual Additional Optimization Options for Finer Control, ACC +O3 prog.C, ACC +O4 prog.C