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 

ice with do i = 1,n

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



Joined: 16 Feb 2006
Posts: 2001
Location: Sydney

PostPosted: Wed Jan 10, 2018 7:19 am    Post subject: ice with do i = 1,n Reply with quote

The following code produces an ICE when compiled with 32-bit or 64-bit when n >= 2**31

0010) do i = 1,n ! works with = one,n
*** Error 637: Internal compiler error - floating point exception

However it works with do I = one,n or if n < 2^31

This occurs for Ver 8.20 and earlier versions that I have tested.

Code:
   integer*4, parameter :: million = 1000000
   integer*8, parameter :: billion = 1000*million
   integer*8, parameter :: n = 3*billion ! works with 1*billion
   integer*4 :: one = 1
   integer*8 :: i
   real*8    :: s, e, d

   d = 0.001d0
   s = 0
   do i = 1,n   ! works with = one,n
     s = s + d
   end do

   e = n*d
   write (*,*) 'n=',  n
   write (*,*) 's,e=',s, e
   write (*,*) 's-e=',s-e
   end
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jan 10, 2018 8:24 am    Post subject: Reply with quote

Thanks John. I have made a note of this.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2001
Location: Sydney

PostPosted: Wed Jan 10, 2018 12:22 pm    Post subject: Reply with quote

integer*4, parameter :: one = 1
...
do i = one,n ! this fails

while
integer*4 :: one = 1
...
do i = one,n ! this is ok
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 136
Location: Chennai, IN

PostPosted: Wed Jan 10, 2018 12:33 pm    Post subject: Reply with quote

Hi John
I am very much astonished to believe that such a compilation errors exist. But, good that it has been identified. This really helps, to improvise our FTN95.
Thank you
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jan 10, 2018 1:29 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
mecej4



Joined: 31 Oct 2006
Posts: 1025

PostPosted: Wed Jan 10, 2018 2:10 pm    Post subject: Reply with quote

The following variant of John's example involves no REAL variables of any KIND, but the 8.10 compilers (32 and 64 bit targets) abort compilation with a startling error message.

The modified source code:
Code:
   program fbug
   implicit none
   integer*8, parameter :: n = 3_4*1000_4*1000_4*1000_4 ! 3 billion
   integer*4 :: one = 1
   integer*8 :: i , s, d

   print *,' n = ',n
   d = 2
   s = 0

   do i = 1_4,n   ! works with = one,n
     s = s + d
   end do

   write (*,*) 'n, s =',  n , s
   end

The compiler's error message:
Code:
s:\FTN95>ftn95 fbug.f90 /64 /lgo
[FTN95/x64 Ver. 8.10.0 Copyright (c) Silverfrost Ltd 1993-2017]
0011)    do i = 1_4,n   ! works with = one,n
*** Internal compiler error - floating point exception
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jan 10, 2018 3:44 pm    Post subject: Reply with quote

The current fix also works for this variant.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1025

PostPosted: Wed Jan 10, 2018 4:26 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
The current fix also works for this variant.

Thanks, Paul.

Impressive: A fix was provided to a problem just six hours after the problem was reported!
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 959
Location: Aerospace Valley

PostPosted: Wed Jan 10, 2018 10:48 pm    Post subject: Reply with quote

Even more impressive is the fixing of your problem, mecej4, 41 minutes BEFORE you had identified your problem ! ... and without even knowing of your problem ! now that's MEGA IMPRESSIVE !!! Wink
This bodes well for future %pl activities Paul , and could also spell the death of the dan devil Wink LOL
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2001
Location: Sydney

PostPosted: Fri Jan 12, 2018 1:25 am    Post subject: Reply with quote

Paul,

Thanks for the prompt response to this and other fixes.
Could a Ver 8.21 be made available ?

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jan 12, 2018 9:05 am    Post subject: Reply with quote

John

That is an option that is being considered.
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