3

–O3,-xO3

Same as -O2, but optimizes the uses and definitions of external variables. Level -O3does not trace the effects of pointer assignments. Do not use Level -O3when compiling device drivers or programs that modify external variables from within signal handlers.

–O4,-xO3

Same as -O3, but traces the effects of pointer assignments and gathers alias information. Do not use Level -O4when compiling device drivers or programs that modify external variables from within signal handlers.

-O5,-xO5

(Solaris 2.x only) Generates the highest level of optimization. This level uses optimization algorithms that take more compilation time or that do not have as high a certainty of improving execution time.

Optimization at this level is more likely to improve performance if it is done with profile feedback. See -xprofile.

Note – Levels -O3and -O4may result in an increase in the size of the executables. When optimizing for size, use level -O2. For most programs, –O4is faster than –O3, which is faster than –O2, which is faster than –O1. However, in a few cases –O2may be faster than the others, and –O3may be faster than –O4. You can try compiling with each level to see if you have one of these rare cases.

If the optimizer runs out of memory, it tries to recover by retrying the current procedure at a lower level of optimization, then resumes subsequent procedures at the original level specified in the –Ocommand-line option.

If you optimize at –O3or –O4with very large procedures (thousands of lines of code in a single procedure), the optimizer may require an unreasonable amount of memory. Such cases may result in degraded machine performance.

You can prevent this from happening in the C shell by limiting the amount of virtual memory available to a single process. To do this, use the limit command (see csh(1)).

For example, to limit virtual memory to 16 megabytes:

hostname% limit datasize 16M

The Pascal Compiler

37

Page 61
Image 61
HP SunSoft Pascal 4.0 manual Hostname% limit datasize 16M