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

Preparing Your Program for the Accelerator
Accelerator Manual527303-002
3-12
Relationship Between Global and Local Data Blocks
The Accelerator issues the following warning when you accelerate the preceding
example:
Warning 32: The return value sizes derived for the following
procedures conflict with those given in the Binder region:
'Foo'; 2 derived by the Accelerator;
3 given in the Binder region
Acceleration is based on the Binder region; you can override
that value with a ReturnValSize option.
Instead of recompiling, you can use the following ReturnValSize option to produce a
correctly accelerated program:
ReturnValSize 'Foo' 2
Relationship Between Global and Local Data Blocks
Do not assume that global and local data blocks have the same relation to one another
on TNS/R systems as they have on TNS systems. For example, on TNS systems it is
possible to write TAL code that accesses local variables by indexing global variables.
On TNS/R systems, the indexed global variables might not be equivalent to local
variables because of register optimization.
The Accelerator does not detect when programs dangerously manipulate values
between the global and local data blocks. The accelerated code might execute, but the
results would be incorrect.
Required Change
You must remove this coding practice from all programs.
Example
In the following program, the global variable f, an integer, is accessed as an array
in the local block of the program. The Accelerator does not see the address of the
array access, f[4], as equivalent to the variable c in the local data block.
INT f; ! Global variable
PROC Test MAIN;
BEGIN
INT a,b,c,d; ! Local variables
c := 1;
f[4] := c+100; ! Undefined on TNS/R systems
b := c+3;
END;
If you execute this program on a TNS system or as TNS code on a TNS/R system,
b = 104 at the end of the procedure. If you accelerate this program and then
execute it on a TNS/R system, b = 4.