Object Code Accelerator Manual

OCA Syntax and Option Summary
Object Code Accelerator Manual528144-003
5-6
Diagnosing and Managing Register or Condition
Code Inheritance
can use the INHERITSRn option to generate correct code, though it is best to modify
the source code to eliminate this practice and then reaccelerate the program.
Diagnosing Register or Condition Code Inheritance
OCA can falsely warn of register or code condition inheritance. This can be because
either:
The procedure calls DEBUG
The caller declares a USE variable that was declared, but has not yet been
initialized at some procedure or supersedure call.
For example the following code sample contains an uninitialized USE variable that
is not DROPped before a procedure call:
PROC fred;
BEGIN
USE i;
CALL do_something;
i := jane
DROP i;
END;
Restructure the code sample to DROP or defer the USE variable before the call:
PROC fred;
BEGIN
USE i;
DROP i;
CALL do_something;
i := jane
END;
If a code (RDE) statement appears to sample an as yet uninitialized ENV.NZ
condition code, OCA can interpret this as a sampling of the caller’s condition code.
Managing Register or Code Condition Inheritance
OCA warns you if a procedure appears to use a CC or R0..R7 register value before the
register is set by that procedure. If a Warning 15 or Warning 16 is displayed it could
signify one of a few manageable conditions, including one where the procedure
expects to “inherit” the register from a calling procedure. The following options help you
manage conditions when OCA issues Warning 15 or 16. Warning 15 displays when
OCA detects that a register from the TNS register stack may hold an implicitly passed
register value. Warning 16 displays when OCA detects that the condition codes may