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

Internal Compiler Error, module with abstract interface

mecej4
Honored Contributor III
571 Views
This is a drastically pared version of the code posted recently by benji1986, "Internal Compiler Error":

[fortran]module parameters

  implicit none
  integer :: ncon

end module parameters

module jacksort

  implicit none

  abstract interface
     pure function error_template ( x )
       use parameters, only: ncon
       real, dimension(0:, 0:), intent(in) :: x
       real, dimension(ncon)               :: error_template
     end function error_template
  end interface

  procedure(error_template), pointer :: errorfunction => null()

contains

  subroutine Error ( cset )
    use parameters, only: ncon
    real, dimension(0:, 0:), intent(inout) :: cset
    cset(1:ncon, ncon+1) = errorfunction(cset(0:ncon, 0:ncon))
  end subroutine Error

end module jacksort
[/fortran]
Versions 11.1.070 and 12.0.2 of the Windows Ifort compiler, 32-bit and 64-bit, give an ICE when compilation is
attempted:

[bash]Intel Visual Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.2.154 Bu
ild 20110112
Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.

0_12307

: catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circ
umstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit ca
use of this error.
compilation aborted for jack.f90 (code 1)
[/bash]

0 Kudos
5 Replies
Steven_L_Intel1
Employee
571 Views
Thanks - escalated as issue DPD200167044.
0 Kudos
Ben3
Beginner
571 Views
Thanks.

It's worth noting that if you remove the dependency from the interface, like this:

[fortran]  abstract interface
     pure function error_template ( x )
       real, dimension(0:, 0:), intent(in) :: x
       real, dimension(10)                 :: error_template
     end function error_template
  end interface[/fortran]
then it will compile with no problems.

Ben
0 Kudos
mecej4
Honored Contributor III
571 Views
Since you pull in wp and ncon at the module level, you may use them in the abstract interfaces using the import feature of F2003, instead of USE statements in the interfaces:

[fortran]  abstract interface
     pure real(wp) function error_template1 ( x )
       import :: wp
       real(wp), dimension(0:), intent(in) :: x
     end function error_template1
  end interface

  abstract interface
     pure function error_template2 ( x )
       import :: wp, ncon
       real(wp), dimension(0:, 0:), intent(in) :: x
       real(wp), dimension(ncon)               :: error_template2
     end function error_template2
  end interface
[/fortran]
With these modifications, the file jacksort.f90 (in your posted sources.tar.gz) gets compiled without errors.



0 Kudos
Steven_L_Intel1
Employee
571 Views
Yes, the change mecej4 describes is the correct workaround.
0 Kudos
Steven_L_Intel1
Employee
571 Views
This problem has been fixed for a future major compiler version. In the meantime, the workaround suggested should be used.
0 Kudos
Reply