|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Thu May 18, 2017 11:34 am Post subject: Problem DATA/EQUIVALENCE Statement |
|
|
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. Code: |
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 |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Fri May 19, 2017 1:23 am Post subject: |
|
|
There is definitely a problem with /64. I tested in Plato with Debug x64.
I initially tried to separate the definitions, but that did not fix the problem.
Commenting out the data definition on lines 4 and 8 removes the reported error for /64 ( or the data statements in the original post)
Code: | c equiv.for
c
CHARACTER*16 MYTXT1
INTEGER*4 :: MYIARRAY1(4) = (/ 11 , 12 , 13 , 14 /)
EQUIVALENCE (MYTXT1,MYIARRAY1)
c
CHARACTER*16 MYTXT2
INTEGER*4 :: MYIARRAY2(4) = (/ 21 , 22 , 23 , 24 /)
EQUIVALENCE (MYTXT2,MYIARRAY2)
c
write (*,*) 'mytxt1 ',loc (mytxt1)
write (*,*) 'mytxt2 ',loc (mytxt2)
write (*,*) 'MYIARRAY1',loc (MYIARRAY1)
write (*,*) 'MYIARRAY2',loc (MYIARRAY2)
c
MYIARRAY1 = (/ 11 , 12 , 13 , 14 /)
MYIARRAY2 = (/ 21 , 22 , 23 , 24 /)
c
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
c
end |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Fri May 19, 2017 9:05 am Post subject: |
|
|
I have made a note that this needs fixing. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Mon Jun 05, 2017 3:46 pm Post subject: |
|
|
This has now been fixed for the next release of FTN95. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|