HP SunSoft Pascal 4.0 User Manual

Page 61

Advertising
background image

The Pascal Compiler

37

3

–O3

,

-xO3

Same as

-O2

, but optimizes the uses and definitions of external variables.

Level

-O3

does not trace the effects of pointer assignments. Do not use

Level

-O3

when 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

-O4

when 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

-O3

and

-O4

may result in an increase in the size of the

executables. When optimizing for size, use level

-O2

. For most programs

,

–O4

is faster than

–O3

, which is faster than

–O2

, which is faster than

–O1

.

However, in a few cases

–O2

may be faster than the others, and

–O3

may 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

–O

command-line option.

If you optimize at

–O3

or

–O4

with 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

Advertising