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

Type Extension & Bindings ICE

jahern
Beginner
522 Views
Hello,

I get a catastrophic error when attempting to compile the following with ifort 11.1.056 (20090827), with no compiler flags other than "-c".
[plain]MODULE bug2
   IMPLICIT NONE

   TYPE, ABSTRACT :: Shape
   CONTAINS
      PROCEDURE(ReturnInt), DEFERRED :: nDims
   END TYPE Shape
   ABSTRACT INTERFACE
      FUNCTION ReturnInt(this)
         IMPORT :: Shape
         CLASS(Shape), INTENT(IN) :: this
         INTEGER :: ReturnInt
      END FUNCTION ReturnInt
   END INTERFACE

   TYPE Container
      CLASS(Shape), ALLOCATABLE :: obj
   CONTAINS
      PROCEDURE :: nDims => nDims_Container
   END TYPE Container

   TYPE, EXTENDS(Shape) :: Triangle
      INTEGER :: points(3)
   CONTAINS
      PROCEDURE :: nDims => nDims_Triangle
   END TYPE Triangle

CONTAINS

FUNCTION nDims_Container(box) RESULT(nDims)
   IMPLICIT NONE
   CLASS(Container), INTENT(IN) :: box
   INTEGER :: nDims
   IF (ALLOCATED(box%obj)) THEN
      nDims = box%obj%nDims()
   ELSE
      STOP
   ENDIF
END FUNCTION nDims_Container

FUNCTION nDims_Triangle(this) RESULT(nDims)
   IMPLICIT NONE
   CLASS(Triangle), INTENT(IN) :: this
   INTEGER :: nDims
   nDims = 2
END FUNCTION nDims_Triangle

END MODULE bug2[/plain]
I believe that this code is valid, but in any event, its compilation should clearly not result in an ICE. The error message I obtain is:
[plain]bug2.F90(35): 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.
      nDims = box%obj%nDims()
--------------^
compilation aborted for bug2.F90 (code 3)[/plain]
Thanks,
Jared

0 Kudos
2 Replies
Kevin_D_Intel
Employee
522 Views

Thank you for the convenient reproducer Jared. I believe this is similar to other reports we've received recently. I will forward to Development and update this post when I learn more.
0 Kudos
jahern
Beginner
522 Views

Thank you for the convenient reproducer Jared. I believe this is similar to other reports we've received recently. I will forward to Development and update this post when I learn more.

Not a problem. I've encountered a fair number of problems with the new type extension features, particularly when used with polymorphic/nested derived types. A running problem for me is still that error#8307 is still issued on some valid code, as of 11.1.056. I'll keep submitting them.
0 Kudos
Reply