Silverfrost Forums

Welcome to our forums

Internal compiler error - floating point exception

1 May 2022 12:33 #28958

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.

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
2 May 2022 9:23 #28962

mecej4

Thank you for the bug report.

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

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

But

r = ishft(4294967295_i8,-24) 

fails to compile.

2 May 2022 9:33 #28963

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.

16 Jul 2022 9:04 #29176

This bug has been fixed for the next release of FTN95 and the DLLs.

Please login to reply.