View previous topic :: View next topic |
Author |
Message |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Wed Jan 10, 2018 7:19 am Post subject: ice with do i = 1,n |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Jan 10, 2018 8:24 am Post subject: |
|
|
Thanks John. I have made a note of this. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Wed Jan 10, 2018 12:22 pm Post subject: |
|
|
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 |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Wed Jan 10, 2018 12:33 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Jan 10, 2018 1:29 pm Post subject: |
|
|
This has now been fixed for the next release of FTN95. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Wed Jan 10, 2018 2:10 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Jan 10, 2018 3:44 pm Post subject: |
|
|
The current fix also works for this variant. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Wed Jan 10, 2018 4:26 pm Post subject: Re: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Jan 10, 2018 10:48 pm Post subject: |
|
|
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 !!!
This bodes well for future %pl activities Paul , and could also spell the death of the dan devil LOL |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Fri Jan 12, 2018 1:25 am Post subject: |
|
|
Paul,
Thanks for the prompt response to this and other fixes.
Could a Ver 8.21 be made available ?
John |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Fri Jan 12, 2018 9:05 am Post subject: |
|
|
John
That is an option that is being considered. |
|
Back to top |
|
|
|