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

Catastrophic internal compiler error with (apparently?) valid parameterised derived type code

Warrick
Beginner
957 Views

I've come across an internal compiler error with ifort 19.0.1.144 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.

0 Kudos
6 Replies
FortranFan
Honored Contributor II
944 Views

@Warrick ,

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.

 

0 Kudos
Johannes_Rieke
New Contributor III
939 Views

Hi, I confirm the behavior for 19.1.2.254 (PSXE2020u2).

However, if you change:

use types

to

use types, only : test_type, assign_from_self

it compiles fine.

I added a modified working version. Maybe that's a workaround?

0 Kudos
Johannes_Rieke
New Contributor III
937 Views

Sorry, with the use only, the assignment is not needed and the ICE therefor is gone. My fault.

0 Kudos
Ron_Green
Moderator
903 Views

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


Ron


Warrick
Beginner
875 Views

Thanks! I presume there's nothing further to do on my side.

0 Kudos
Ron_Green
Moderator
454 Views

@Warrick this issue is fixed in the 2023.2.0 oneAPI packages, ifort 2021.10 and ifx 2023.2.0

0 Kudos
Reply