Operating System: Red Hat Enterprise Linux 5.3
Intel Fortran Compiler: ifort (IFORT) 13.0.1 20121010
According to the Intel Fortran documentation, the –save compiler option saves all variables in static allocation except local variables within a recursive routine and variables declared as AUTOMATIC. I recently discovered what appears to be a difference in the interpretation of this option between two different computer systems.
Consider the following code segment which is called multiple times:
DOUBLE PRECISION Function GetValue(a, b, c, d)
DOUBLE PRECISION a, b, c, d
GetValue = a + b + c + d
On a SGI UNIX system with the code segment compiled with the -static option (equivalent to -save and -zero), the previous value of GetValue has been saved and is printed out. Under RHEL 5.3 with the code segment compiled with the –save and -zero options, the previous value of GetValue has not been saved and is printed as zero. Is this a compiler bug?