When using the DATA and EQUIVALENCE statement twice with respect to 2 strings and 2 integer arrays the contents of the second integer array does not correspond to the contents of the data statement.
CHARACTER*16
*MYTXT1,
*MYTXT2
INTEGER*4
*MYIARRAY1(4),
*MYIARRAY2(4)
EQUIVALENCE(MYTXT1,MYIARRAY1)
EQUIVALENCE(MYTXT2,MYIARRAY2)
DATA MYIARRAY1 /
*11 , 12 , 13 , 14 /
DATA MYIARRAY2 /
*21 , 22 , 23 , 24 /
write(2,'(A13,I16,2X,A16,I32)') 'MYIARRAY1(1)=',MYIARRAY1(1),
*'LOC(MYIARRAY1(1))=',LOC(MYIARRAY1(1))
write(2,'(A13,I16,2X,A16,I32)') 'MYIARRAY2(1)=',MYIARRAY2(1),
*'LOC(MYIARRAY2(1))=',LOC(MYIARRAY2(1))
stop
end
The 64 bit executable prints the lines
MYIARRAY1(1)=21 LOC(MYIARRAY1(1))= 4214896 MYIARRAY2(1)=21 LOC(MYIARRAY2(1))= 4214896
However, we expect both the values of MYIARRAY1(1) and MYIARRAY2(1) and their locations to be different, respectively.
The 32 bit version of the code printes then lines
MYIARRAY1(1)=11 LOC(MYIARRAY1(1))= 4210704 MYIARRAY2(1)=21 LOC(MYIARRAY2(1))= 4210688
which matches my expectations.
If commenting/deactivating the second EQIVALENCE statement and creating the corresponding 64 bit executable, the 64 bit executable prints
MYIARRAY1(1)=11 LOC(MYIARRAY1(1))= 4214896 MYIARRAY2(1)=21 LOC(MYIARRAY2(1))= 4214912
which again matches my expectations.
Regards, Dietmar