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

ICE with type hierarchy and length param

IanH
Honored Contributor II
389 Views

I have been away from my Fortran compilers for too long.  As part of getting back into the swing of things, here's an ICE.

MODULE ICE20170607
  IMPLICIT NONE
  
  PRIVATE
  
  TYPE, PUBLIC, ABSTRACT :: GrandParent
  CONTAINS
  END TYPE GrandParent
  
  TYPE, EXTENDS(GrandParent), ABSTRACT :: Parent(num)
    INTEGER, LEN :: num
    REAL :: array_comp(num-1)
  END TYPE Parent
  
  TYPE, EXTENDS(Parent) :: Child
  END TYPE Child
CONTAINS
  SUBROUTINE bar(array)
    REAL, INTENT(IN) :: array(:)
    TYPE(Child(:)), ALLOCATABLE :: tmp
    
    ALLOCATE(Child(SIZE(array)+1) :: tmp)
  END SUBROUTINE bar
END MODULE ICE20170607

 

>ifort ice-20170607.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.4.210 Build 20170411
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

ice-20170607.f90(24): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
    ALLOCATE(Child(SIZE(array)+1) :: tmp)
^
[ Aborting due to internal error. ]
compilation aborted for ice-20170607.f90 (code 1)

Causes grief for the 18 beta too.

0 Kudos
1 Reply
Devorah_H_Intel
Moderator
389 Views

Hi Ian,

Thank you for the report. I was able to test the code with the same result. This issue is escalated to development for fix.

 

0 Kudos
Reply