Accelerator Manual (G06.24+, H06.03+)

Preparing Your Program for the Accelerator
Accelerator Manual527303-002
3-7
Non-Standard Procedure Call or Return RP Values
those of TNS object code, but only if an overflow occurs. It is unlikely that programs
knowingly use left-shift operations that overflow.
Detection Guideline
Look for arithmetic left-shift operations that overflow.
Required Change
Remove arithmetic left-shift operations that overflow from your programs.
Example
In TNS object code, the value of I is 0, while in accelerated object code, I= %100000.
INT I;
I := %040000 << 1; ! Overflow in accelerated object code.
Non-Standard Procedure Call or Return RP Values
Procedures and subprocedures in TAL and C can return a different number of words in
the register stack than the number declared in the routine’s source code. The
Accelerator determines the return value sizes for most of these procedures from
information found in the Binder region and its control flow analysis. In some cases, the
Accelerator predicts the return value sizes and emits a run-time check to make sure its
predictions are correct. If the Accelerator makes an incorrect prediction, the program
makes a transition into TNS code at that point. The Accelerator, however, does not
determine or predict the return value size when the compiler-declared values in the
Binder region conflict with the Accelerator’s control flow analysis. In these rare cases,
you must tell the Accelerator the size of the value returned by a procedure.
Detection Guidelines
The Accelerator issues Warning 32:
Warning 32: The return value sizes derived for the
following procedures conflict with those given in the
Binder region:
<proc name>; <value 1> derived by the Accelerator;
<value 2> given in the Binder region
Acceleration is based on the Binder region; you can
override that value with a ReturnValSize option.
Do not ignore this warning. In TAL programs, check for use of the RP directive, CODE
statements, or STACK statements to force TAL into allowing values to stay in the
register stack across procedure calls. In C programs, look for functions that return the
type “void *” (a generic pointer) or return a struct by value.