Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

-save compiler option question

$
0
0

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)
IMPLICIT NONE
DOUBLE PRECISION a, b, c, d
WRITE(6,10) GetValue
10 FORMAT(F8.4)
GetValue = a + b + c + d
RETURN
END

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?

Thanks…


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>