soccer jersey forums.silverfrost.com :: View topic - Inconsistent detection of uninitialised arrays
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inconsistent detection of uninitialised arrays

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1896

PostPosted: Mon Mar 08, 2021 4:31 am    Post subject: Inconsistent detection of uninitialised arrays Reply with quote

Programs containing uninitialised real arrays with more than 256 elements can have these arrays unexpectedly become initialised to 0.0 and the bug can go undetected, even when /undef has been used, when building and running 64-bit programs.

The following code illustrates the problem. All the runs were with FTN95 8.70, and with /64. Compiling for 32-bits does not give rise to any of these problems.

Code:
program BAADF00D
   implicit none
   real , dimension(257) :: conc
   print *,conc(1)                   ! Printing uninitialised variable!!
   stop
end program BAADF00D


When I ran this program after compiling with /64, or with /64 /opt, it printed various values including 0.00000.

When I used /64 /debug, I found in SDBG64 that the array was filled with -0.00132704, which has an IEEE-32-bit representation of Z'BAADF00D'. Running the EXE prints out various values.

When I used /64 /undef or /64 /checkmate, I found in SDBG64 that the array was filled with 0.0, and the program printed 0.00000.

I then changed the value of the dimension of the array CONC to 256, and normal behaviour was recovered. Using /64 /debug fills the array with 0 and the program prints 0.00000. Using /64 /check causes the output of ????????????????, and SDBG64 displays the values of the array elements as UNDEFINED. Using /64 /undef causes the program to abort with a pop-up window, as desired, and the array element values are shown as 'UNDEFINED'.


Last edited by mecej4 on Mon Mar 08, 2021 9:37 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8016
Location: Salford, UK

PostPosted: Mon Mar 08, 2021 9:03 am    Post subject: Reply with quote

mecej4

Thank you for reporting this error. I have logged this for investigation.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8016
Location: Salford, UK

PostPosted: Wed Mar 31, 2021 11:20 am    Post subject: Reply with quote

This has now been fixed for the next release of FN95.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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