I've come across an internal compiler error with ifort 22.214.171.124 with some code that defines assignment for a parameterised derived type. I've stripped the project code down to this minimal example:
module types implicit none type :: test_type(n) integer, len :: n ! Length of array of independent variables integer :: t(n) end type test_type interface assignment(=) module procedure assign_from_self end interface assignment(=) contains subroutine assign_from_self(this, other) type(test_type(n=*)), intent(out) :: this type(test_type(n=this%n)), intent(in) :: other this%t = other%t end subroutine assign_from_self end module types program ifort_bug use types implicit none call test_subroutine(3) contains subroutine test_subroutine(n) integer, intent(in) :: n type(test_type(n=n)) :: x end subroutine test_subroutine end program ifort_bug
If I try to compile this (saved as ifort_bug.f90), I get the following error:
$ ifort ifort_bug.f90 -o ifort_bug.x ifort_bug.f90(1): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it oc curred in a Software Problem Report. Note: File and line given may not be explicit cause of this error. compilation aborted for ifort_bug.f90 (code 1)
I know parameterised derived types have limited support and there are many known issues (recentish examples here and here) . In fact, the offending block in our program is probably going to be removed because it's causing problems in other compilers too. But I figure it's still worth raising in the hope that it'll be fixed someday!
I use ifort via an institutional license and I'm not sure how to access the Online Support Centre.
Thank you for your post, yep defined assignment and defined operators are among the other aspects with parameterized derived types that cause the Intel Fortran compiler to trip over, an internal compiler error (ICE) being an especially pernicious manifestation of the underlying issues with the implementation (or faults thereof) of this feature in the compiler.
I hope someone from Intel team will take note of your post and file a compiler bug report on your behalf.
I filed a bug, ID is CMPLRIL0-23475 for the original code and ICE
This affects 19.0.x 19.1.x and 2021.1-beta
We have been fixing a number of things in PDTs so this fits in with that effort. Thank you for bringing this to the Forum