The following code
PROGRAM TEST
INTEGER*2 I2, I2C
INTEGER*4 I4, I4C
REAL*4 R4, R4C
REAL*8 R8, R8C
Common /COMTES/ R8C,R4C,I4C,I2C
#IF _WIN64
write(*,*) '64 Bit exe'
#ELSE
write(*,*) '32 Bit exe'
#ENDIF
WRITE(*,*) 'I2: ', I2, I2C
WRITE(*,*) 'I4: ', I4, I4C
WRITE(*,*) 'R4: ', R4, R4C
WRITE(*,*) 'R8: ', R8, R8C
END
named test.for is compiled using both the 32 bit and the 64 bit Version of SALFORD ftn95 version 8.70.0.
The resulting executable produces output which consists of 2 columns, the first of which consists of 4 local variables I2, I4, R4 and R8, the second of which consists of 4 common block variables I2C, I4C, R4C and R8C. For the 32 bit version of the executables all variables are initialised to 0. For the 64 bit version of the executable the common block variables are not always initialised to 0. Unfortunately, we cannot reproduce this behaviour, we observed many cases where the common block variables are initialised correctly for the 64 bit version, as well. The mistaken initialisation (to a non zero value) occurs for all types of common variables (i.e. for I2C, I4C, R4C and R8C).
We compiled the 64 bit executable via
ftn95 test /64 /ALL_WARNINGS/NON_STANDARD/SINGLE_THREADED/OLD_ARRAYS/ALT_KINDS/PERSIST/ZEROISE/UNLIMITED_ERRORS/FIXED_FORMAT/SAVE/NO_WARN73/WIDE_SOURCE /WINDOWS /include ..;..\..\subinc /CFPP /DEFINE CLEARWIN 1 /DEFINE SALFORD64 1 /debug /link
We do not have any explation for this behaviour, we thought all variable should be initialised to 0 because of ftn95 option /SAVE being set.
The version number of both clearwin64.dll and salflibc64.dll loaded by the executable are 23.1.18.7 .
Has anybody observed similar behviour?
We would appreciate any hint ...
Regards Dietmar