Fortran User's Guide

Optimization and Cray Pointers

For purposes of optimization, f90 assumes the storage of a pointee is never overlaid on the storage of another variable--it assumes that a pointee is not associated with another variable.

Such association could occur in either of two ways:

These kinds of association are sometimes done deliberately, such as for equivalencing arrays, but then results can differ depending on whether optimization is turned on or off.

Example: b and c have the same pointer.


	POINTER ( p, b ),  ( p, c )
	REAL x, b, c
	p = LOC( x )
	b = 1.0
	c = 2.0
	PRINT *, b
	...

Above, because b and c have the same pointer, assigning 2.0 to c gives the same value to b. Therefore b prints out as 2.0, even though it was assigned 1.0.