Specifies the level of optimization of the code produced by the compiler.
Note: This directive is supported for native COBOL only.
Use this version of the OPT directive on
operating systems that use the Intel x86 chip, for example, Solaris Intel and Unix Ware (this list is not exhaustive).
Syntax:
>>-.---.--OPT--"integer"-------------------><
+-/-+
Parameters:
-
integer
- The level of optimization; one of:
- 1
- Minimal optimization.
- 2
- Default optimization.
- 3
- Additional optimization - particularly of STRING, UNSTRING and INSPECT. This option increases the time taken to generate a program in comparison to the default optimization.
- 4
- Optimized as for option 3, but in addition the code is scheduled. This option increases the time taken to generate a program in comparison to option 3.
Properties:
Default:
|
OPT"2"
|
Phase:
|
Generate
|
$SET:
|
Any
|
Dependencies:
If no other OPT level is specified, set to OPT"1" at end by ANIM.
Comments:
OPT is the equivalent of OPT"3".
Debugging code compiled with an OPT level greater than 1 can be difficult, as compiler optimizations reorganize instructions derived from your source in such a way that, for example, Step might appear to jump statements or execute statements out of order, and Query and Modify might not work as expected.