Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Compiler error - 12.0 Update 2

mecej4
Honored Contributor III
666 Views
The program below can be compiled and run correctly with the 32 and 64 bit 12.0.2.154 compilers if no options are specified. If the option /warn is used, both compilers abort with

[bash]fortcom: Fatal: There has been an internal compiler error (C0000005).
compilation aborted for tsimp.f90 (code 1)
[/bash]
Here is the program.

[fortran]module funmod
abstract interface
function fn(x) result(y)
real, intent(in) :: x
real :: y
end function fn
end interface
end module funmod

function simp(a,b,h,fun) result(fi) ! integrate fun(x) a-step_h-b
use funmod
procedure(fn) :: fun
real, intent(in):: a,b,h
real :: fi,x,p
integer i,n
n=nint((b-a)/h)
fi=fun(a)+fun(b)
p=4.0
do i=2,n
x=a+(i-1)*h
fi=fi+p*fun(x)
p=6.0-p
end do
fi=fi*(b-a)/(3.0*n)
return
end function simp

function cub(x)
real, intent(in) :: x
cub = x*x*x
return
end

function sqr(x)
real, intent(in) :: x
sqr = x*x
return
end function sqr

program tsimp
use funmod
procedure(fn) :: cub, sqr
real :: a=1.0,b=2.0,h=0.05
interface
function simp(a,b,h,fun) result(fi)
use funmod
procedure(fn) :: fun
real, intent(in) :: a,b,h
real :: fi
end function simp
end interface

write(*,10)'cub',simp(a,b,h,cub)
write(*,10)'sqr',simp(a,b,h,sqr)

10 format(1x,A3,2x,F10.4)
end program tsimp
[/fortran]

0 Kudos
2 Replies
Steven_L_Intel1
Employee
666 Views
/warn:interface is the culprit here, which is implied by /warn. Either don't use /warn or specify only those suboptions you want (other than "interface"). I will report this to the developers. Issue ID is DPD200166965.
0 Kudos
Steven_L_Intel1
Employee
666 Views
I expect the fix for this to appear in 12.0 Update 4.
0 Kudos
Reply