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 

Optimiser bug, 32-bit FTN95 8.10, namelist input

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



Joined: 31 Oct 2006
Posts: 976

PostPosted: Tue Apr 10, 2018 4:46 pm    Post subject: Optimiser bug, 32-bit FTN95 8.10, namelist input Reply with quote

The following program is a compacted bug demonstrator; it does nothing useful, but should run, read data from a file and print a single line of output.
Code:
program swmol3
   implicit none
   integer, parameter :: nht = 7
   integer , dimension(nht) :: iad
   integer :: inutmp, natype, nsymop, id3, nont, i
   character , dimension(3) :: symop*3
   character :: title1*72, title2*72
   namelist /molb/inutmp, title1, title2, natype, nsymop, symop, id3
   data id3,nont,inutmp/ 0,1,0/
   data title2/ '        '/
   data symop/ 3*'   '/
   open(15, file='int.inp', status='old', form='formatted')
   rewind(15)
   read (15, nml=molb)
   write (6, *) 'MOLB namelist read'
   close(15)
   stop
               ! *** NOTE: the code below will never be executed,
               ! *** but the bug depends on some part of it!
   do i = 1, natype
      iad(i) = 0
   end do
   write (*, *) natype, nsymop, iad
   stop
end


The data file, 'int.inp', contains:
Code:
 &molb
  title1='O2 TZ (Dunning) EMSL',
  natype=1, nsymop=3, symop='X','Y','Z'
 /end


The bug occurs when /opt is used. The 64-bit compiler will not even compile the code with /opt, as reported earlier: http://forums.silverfrost.com/viewtopic.php?t=3752&highlight=amdfillnamelistblock

When compiled with /opt in 32-bit mode, the code aborts with the following report:
Code:
Runtime error from program:s:\ftn95\reads.exe
Access Violation
The instruction at address 10138c5c attempted to write to location 00403f98

 10138bdb read_INTEGER_4(<ref>int) [+0081]
 10139eaa read_namelist_value(char,<ptr>void,int,int,int) [+00a1]
 1013beab RNML__ [+042d]
 1011f72a doIO(void) [+0450]
 10127ba0 IOSTART__ [+0275]
 00401000 SWMOL3 [+016a]

Curiously, the bug surfaces only if some lines of code that have no path to them are left in the source file, as noted in the comments in the source.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Apr 12, 2018 7:29 am    Post subject: Reply with quote

Thank you. I have made a note of this.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Apr 12, 2018 8:15 pm    Post subject: Reply with quote

This has now been fixed for the next release of FTN95.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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