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

Internal compiler error - call to type bound procedure

hs-napa
Beginner
554 Views
Hi,

Compiling the following code gives an internal compiler error with compiler version 11.1.067. The code compiles and works fine with version 11.1.054.

[bash]MODULE BASE_MOD

   IMPLICIT NONE

   PUBLIC :: BASE

   PRIVATE

   TYPE, ABSTRACT :: BASE
      INTEGER :: I
   CONTAINS
      PROCEDURE(IFUNC), DEFERRED :: GET_INTEGER
      PROCEDURE :: CALL_DEFERRED
   END TYPE

   ABSTRACT INTERFACE
      INTEGER FUNCTION IFUNC( THIS )
         IMPORT BASE
         CLASS(BASE) :: THIS
      END FUNCTION
   END INTERFACE

CONTAINS

   SUBROUTINE CALL_DEFERRED( THIS )
      CLASS(BASE) :: THIS
      INTEGER :: I
      I = THIS % GET_INTEGER()
      WRITE(*,*) I
   END SUBROUTINE

END MODULE

MODULE TEST_MOD

   USE BASE_MOD
   IMPLICIT NONE

   PUBLIC :: EXTENDED, NEW

   PRIVATE

   TYPE, EXTENDS(BASE) :: EXTENDED
      INTEGER :: J
   CONTAINS
      PROCEDURE :: GET_INTEGER
   END TYPE

CONTAINS

   INTEGER FUNCTION GET_INTEGER( THIS )
      CLASS(EXTENDED) :: THIS
      GET_INTEGER = THIS % I + THIS % J
   END FUNCTION

   FUNCTION NEW()
      TYPE(EXTENDED) :: NEW
      NEW % I = 1
      NEW % J = 2
   END FUNCTION

END MODULE

PROGRAM TEST
   USE TEST_MOD

   IMPLICIT NONE

   TYPE(EXTENDED) :: T

   T = NEW()
   CALL T % CALL_DEFERRED()

END PROGRAM
[/bash]
>ifort type_extension.f90

Intel Visual Fortran Compiler Professional for applications running on IA-32, Version 11.1 Build 20100806 Package ID: w_cprof_p_11.1.067
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

fortcom: Fatal: There has been an internal compiler error (C0000005).
compilation aborted for type_extension.f90 (code 1)



The problem seems to be compiling the line 72.

The problem also seems to be connected with the PRIVATE statement at line 41. If the PRIVATE statement is removed the code compiles and works.

BR,
-Heikki
0 Kudos
3 Replies
pbkenned1
Employee
554 Views
I can reproduce the ICE. Thanks for reporting this, I'll file a bug report with the developers.

Patrick Kennedy
Intel Developer Support
0 Kudos
pbkenned1
Employee
554 Views
This has been reported to compiler engineering as defect #DPD200161643. I'll keep this thread updated with any developments. The sameissue also exists in the v12.0 compiler.

Patrick
0 Kudos
pbkenned1
Employee
554 Views

This issue is fixed in Composer XE update #3. The update #3 packages are:

l_fcompxe_2011.3.174 (Linux)

w_fcompxe_2011.3.175(Windows)

m_fcompxe_2011.3.167 (Mac OS X)


Patrick
0 Kudos
Reply