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 

Internal compiler error - floating point exception

 
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: 1741

PostPosted: Sun May 01, 2022 1:33 pm    Post subject: Internal compiler error - floating point exception Reply with quote

The following program contains only integer variables, but the compiler aborts with "Internal compiler error - floating point exception", possibly because 8-byte integers are processed using the X87 FPU.

Code:
program bugsi
   implicit none
   integer, parameter :: i8=selected_int_kind(15)
   integer(i8),  parameter :: mask24 = ishft(1_i8,24)-1
   integer(i8),  parameter :: mult1 = 44485709377909_i8
   integer(i8),  parameter :: m11 = iand(mult1,mask24)
   integer(i8),  parameter :: m12 = iand(ishft(mult1,-24),mask24)

   print '(4Z18)',mask24,mult1,m11,m12
end program
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon May 02, 2022 10:23 am    Post subject: Reply with quote

mecej4

Thank you for the bug report.

Roughly speaking, the inline ISHFT is failing for INTEGER*8 values that can't be accommodated in INTEGER*4. It works correctly when not inline as in

Code:
integer,parameter::i8=selected_int_kind(15)
integer(i8) r,v
v = 4294967295_i8
r = ishft(v,-24)
print*, r
end


But
Code:
r = ishft(4294967295_i8,-24)


fails to compile.
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1741

PostPosted: Mon May 02, 2022 10:33 am    Post subject: Reply with quote

Thanks, what you wrote gives me ideas for workarounds. I had been thinking of replacing the problematic constant expressions by BOZ constants, but what you suggest is more readable.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Jul 16, 2022 10:04 am    Post subject: Reply with quote

This bug has been fixed for the next release of FTN95 and the DLLs.
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 -> 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