STGOPT
The STGOPT
option controls storage optimization.
- Default
STGOPT=NO
- YES
- If you specify
STGOPT=YES
, the compiler might discard any or all of the following data items, and does not allocate storage for them.- Unreferenced
LOCAL-STORAGE
andWORKING-STORAGE
level-77 and level-01 elementary data items - Level-01 group items if none of their subordinate items are referenced
- Unreferenced special registers
Note: The STGOPT option is ignored for data items that have the VOLATILE clause. For details, see VOLATILE clause.The compiler will not generate code to initialize discarded data items to the values in their
VALUE
clauses.In addition, with
STGOPT=YES
, data items in theLOCAL-STORAGE SECTION
can be reordered in memory to optimize performance. - Unreferenced
- NO
- If you specify
STGOPT=NO
, the storage for all data items, including unreferenced data items, is allocated by the compiler, data items are never reordered to improve performance, and all data items defined with aVALUE
clause are guaranteed to be initialized, even if they are unreferenced.
You can also use the RULES=(UNREF
| NOUNRA | NOUNRS)
option to control whether to issue warning
messages for unreferenced data items. For details, see RULES.