FORTRAN 77 Language Reference

General Guidelines

There are two alternatives for optimization with pointers.

The second choice also has a suboption: localize pointers to one routine and do not optimize it, but do optimize the routines that do the calculations. If you put the calling the routines on different files, you can optimize one and not optimize the other.

Example: A relatively "safe" kind of coding with -O3 or -O4:


	REAL A, B, V(100,100) 	 This programming unit does
	POINTER ( P, V )      	   nothing else with P other than  
	P = MALLOC(10000)     	 getting the address and passing it.
	... 
	CALL CALC ( P, A )
	...
	END

	SUBROUTINE CALC ( ARRAY, X )
	...
	RETURN
	END

If you want to optimize only CALC at level -O4, then avoid using pointers in CALC.