Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Warrick
Beginner
257 Views

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

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
5 Replies
FortranFan
Honored Contributor II
244 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.

 

Johannes_Rieke
New Contributor III
239 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?

Johannes_Rieke
New Contributor III
237 Views

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

Ron_Green
Moderator
203 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
175 Views

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

Reply