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

Internal compiler error with a derived type with a procedure pointer "container"

FortranFan
Honored Contributor III
619 Views

The following code generates an internal compiler error with compiler version 2015 Beta:

MODULE m

   !..
   IMPLICIT NONE

   !..
   PRIVATE

   TYPE :: s

      !..
      CHARACTER(LEN=:), ALLOCATABLE :: q
      PROCEDURE(fabs), NOPASS, POINTER :: p

   END TYPE s
   
   TYPE :: t
   
      INTEGER :: i1
      TYPE(s) :: bar   
   
   CONTAINS
   
      PRIVATE
      PROCEDURE, PASS(This) :: f
      
      PROCEDURE, PASS(This), PUBLIC :: s2
      
   END TYPE t
   
   INTERFACE
   
      PURE FUNCTION fabs(This) RESULT(RetVal)
         IMPORT :: t
         !.. Argument list
         CLASS(t), INTENT(IN) :: This
         !.. Function result
         INTEGER :: RetVal
      END FUNCTION fabs

   END INTERFACE

CONTAINS

   PURE FUNCTION f(This) RESULT(RetVal)
      
      !.. Argument list
      CLASS(t), INTENT(IN) :: This
      !.. Function result
      INTEGER :: RetVal
      
      RetVal = This%i1
      
      RETURN
      
   END FUNCTION f
   
   SUBROUTINE s2(This)
   
      CLASS(t), INTENT(INOUT) :: This
   
      This%bar = s("s1", f)
      
      RETURN
   
   END SUBROUTINE s2

END MODULE m

The output is as follows:

------ Build started: Project: TestFor, Configuration: Release|Win32 ------

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.0.070 [IA-32]...
m.f90
C:\..\sor\m.f90(62): catastrophic error: **Internal compiler error: internal abort** Please report
this error along with the circumstances in which it occurred in a Software Problem Report.
Note: File and line given may not be explicit cause of this error.
compilation aborted for C:\..\sor\m.f90 (code 1)

Build log written to  "file://C:\..\Release\Win32\TestForBuildLog.htm"
TestFor - 1 error(s), 0 warning(s)

 

0 Kudos
6 Replies
FortranFan
Honored Contributor III
619 Views

FWIW, the above code compiles with no errors using gfortran 4.9.

0 Kudos
TimP
Honored Contributor III
619 Views

Similar results with 64-bit ifort 15.0 update 3 and recent gfortran.  ifort dies immediately when it reaches function mp_f, even without optimization.

0 Kudos
FortranFan
Honored Contributor III
619 Views

Tim Prince wrote:

Similar results with 64-bit ifort 15.0 update 3 and recent gfortran.  ifort dies immediately when it reaches function mp_f, even without optimization.

Thanks, Tim.  It appears to have something to do with procedure pointer to a type-bound procedure.  My thinking is the code is consistent with the latest standard and gfortran is handling it correctly and efficiently, based on my unit tests.  However I'll wait to hear from Intel staff.

 

0 Kudos
Kevin_D_Intel
Employee
619 Views

Thank you for reporting the internal error and for the convenient test case. I escalated this to Development (see internal tracking id below). Whether compliant or not (I’ll await Development’s assessment on that) the internal error must be addressed. The internal error also occurs when using our latest Composer XE 2013 SP1 Update 3 (14.0 compiler) too. I will post again after hearing more.

(Internal tracking id: DPD200358902)

(Resolution Update on 11/17/2014): This defect is fixed in the Intel® Parallel Studio XE 2015 Update 1 release (2015.0.148 - Windows)

0 Kudos
Kevin_D_Intel
Employee
619 Views

This defect is fixed in the Intel® Parallel Studio XE 2015 Update 1 release (Version 15.0.1.148 Build 20141023 - Windows) now available from our Intel Registration Center.

0 Kudos
FortranFan
Honored Contributor III
619 Views

Kevin Davis (Intel) wrote:

This defect is fixed in the Intel® Parallel Studio XE 2015 Update 1 release (Version 15.0.1.148 Build 20141023 - Windows) now available from our Intel Registration Center.

Excellent, I just tried it out and it worked.  Thank you much,

0 Kudos
Reply