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

Reproducer for an ifx ICE

zjibben
Novice
1,504 Views

I'm triggering an interesting ICE with ifx (tested 2023.2 through 2025.2). The issue is some edge case combination of using parts of a module which contain a type with a finalizer exposed through an interface block. The reproducer has only declarations, nothing executable, and can be sidestepped with some interesting changes (commented below).

 

This is some simplified code out of AMReX as well as some of my own code depending on it.

 

! ifx -c ice.f90 -o ice.o
! tested triggering ICE with ifx 2023.2 through 2025.2.

module bar_type

  implicit none
  private

  public :: bar_destroy ! removing this line sidesteps the ICE

  type, public :: bar
  contains
    final :: bar_destroy
  end type bar

  ! removing this block sidesteps the ICE
  interface bar_destroy
    module procedure bar_destroy
  end interface bar_destroy

contains

  subroutine bar_destroy(this)
    type(bar), intent(inout) :: this
  end subroutine

end module bar_type


module foo_type

  implicit none

  type :: foo
  contains
    procedure :: f
  end type

contains

  subroutine f(this, x)
    ! using the entire bar_type module (no "only") sidesteps the ICE
    use bar_type, only: bar
    class(foo), intent(in) :: this
    type(bar), intent(in) :: x
  end subroutine

end module foo_type

 

5 Replies
Thomas201Tang
Beginner
1,234 Views

Hello!

You've found an Internal Compiler Error (ICE), which is a bug in the ifx compiler itself. The crash is triggered by a problematic combination of using a type-bound finalizer along with an unnecessary, explicit interface block for that same finalizer. This redundancy confuses the compiler during the module-linking process, especially when you use the use ... only: bar clause. Your workarounds correctly resolve the issue by removing the redundant declaration, and you should report this bug to Intel. 

0 Kudos
AlHill
Super User
1,228 Views

@Thomas201Tang   Your account looks like a spam account.

 

Doc (not an Intel employee or contractor)
[CoPilot is a virus]

0 Kudos
Ron_Green
Moderator
1,013 Views

Bug ID is CMPLRLLVM-70660


zjibben
Novice
961 Views
0 Kudos
JohnNichols
Valued Contributor III
572 Views

Interesting it crashed on ifx on VS 

and IFORT with fortcom: Fatal: There has been an internal compiler error (C0000005).

0 Kudos
Reply