Optimizer Assumptions [ HP Pascal/iX Programmer's Guide ] MPE/iX 5.0 Documentation
HP Pascal/iX Programmer's Guide
Optimizer Assumptions
The optimizer makes the following assumption about variable use when it
optimizes a program: inside a routine, the only variables that can be
accessed indirectly (through a pointer or by another function) are:
* Global variables.
* Reference parameters.
* Local variables that are passed to other routines by reference.
* Local variables or value parameters that are passed to other
routines by reference.
* Local variables or value parameters used by the predefined
function addr. You will violate this assumption if you use
baddress or waddress.
If your program violates this assumption, it will fail when optimized.
You can make the optimizer's job easier by telling it what other
assumptions it can make. To do this, use the compiler option ASSUME
(refer to the HP Pascal/iX Reference Manual or the HP Pascal/HP-UX
Reference Manual, depending on your implementation).
You can derive the assumptions for your program without the overhead of
level two optimization by following these directions:
1. Specify level one optimization. The compiler does not collect
information that only level two requires, but it does collect
sufficient information about the source program to issue notes
that tell you which assumptions you can add to forward and
external declarations to make your program easier to optimize.
2. If you only want to see warnings and not notes, use NOTES OFF (for
more information on the NOTES compiler option, refer to the HP
Pascal/iX Reference Manual or the HP Pascal/HP-UX Reference
Manual, depending on your implementation). NOTES OFF does not
suppress warnings, which the compiler issues if assumptions in
routine headings are invalid. (Chapter 11 explains the
difference between notes and warnings.)
MPE/iX 5.0 Documentation