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

ICE with parameterized derived types with type bound procedures

Nicholas_B_
Beginner
322 Views

Hello

The Intel® Parallel Studio XE 2015 Composer Edition for Fortran Windows* Installation Guide and Release Notes say:

3.5.5 Certain uses of length type parameters in parameterized derived types are not yet
fully implemented
The following uses of length type parameters in parameterized derived types (PDTs) are not yet
fully implemented:

  • PDT parameter constants with length type parameters
  • %RE and %IM are not yet implemented
  • There is a syntax error in the FEE displaying extended types that are parameterized

It looks like type bound procedures and PDTs are not yet implemented in XE 2015 Update 1 either.

The attached code can give an internal compiler error with debug confiurations (release is OK):

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.1.148 [IA-32]...
p_module.f90
p_prog.f90
fortcom: Fatal: There has been an internal compiler error (C0000005).

Uncommenting the line with the call to the type bound procedure gives an error message but does not explain that the the issue is PDTs:

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.1.148 [IA-32]...
p_module.f90
p_prog.f90
...\p_prog.f90(6): error #8607: The procedure interface for the type bound procedure is not yet available.   [GET_LEN]
...\p_prog.f90(6): error #8497: Illegal use of a procedure name in an expression, possibly a function call missing parenthesis.   [GET_LEN]

When is full support for PDTs expected to be implemneted?

Nick

0 Kudos
5 Replies
Steven_L_Intel1
Employee
322 Views

The restrictions mentioned in the release notes don't apply to your program. You've simply uncovered a compiler bug that is triggered by /debug. I will report this to the developers. The issue ID is DPD200363307.

0 Kudos
Steven_L_Intel1
Employee
322 Views

This has been fixed in our sources. I expect the fix to appear in Update 2, planned for February. Compiling without /debug is a workaround.

0 Kudos
Nicholas_B_
Beginner
322 Views

Steve

Thank you for looking at this. It is good to know that the ICE with /debug should be fixed in update 2.

There were really two issues in my original post.

The second issue was the following code failing to compile when I think it is legal code:

module p_module
  implicit none
  type :: p_type(len_p)
     integer, len :: len_p = 10
   contains
     procedure :: get_len => get_p_len
  end type p_type
contains
  integer function get_p_len(this)
    class(p_type(*)), intent(in) :: this
    get_p_len = this%len_p
  end function get_p_len
end module p_module
program p_prog
  use p_module
  implicit none
  type(p_type(10)) :: p10
  write(*,*) p10%get_len() 
end program p_prog

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.1.148 [IA-32]...
ifort /nologo /O2 /standard-semantics /stand:f08 /module:"Release\\" /object:"Release\\" /Fd"Release\vc120.pdb" /libs:dll /threads /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin" "C:\Users\Nicholas\Documents\pdt_bug\p_module_0.f90"
ifort /nologo /O2 /standard-semantics /stand:f08 /module:"Release\\" /object:"Release\\" /Fd"Release\vc120.pdb" /libs:dll /threads /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin" "C:\Users\Nicholas\Documents\pdt_bug\p_prog_0.f90"
C:\Users\Nicholas\Documents\pdt_bug\p_prog_0.f90(5): error #8607: The procedure interface for the type bound procedure is not yet available.   [GET_LEN]
  write(*,*) p10%get_len() 
-----------------^
C:\Users\Nicholas\Documents\pdt_bug\p_prog_0.f90(5): error #8497: Illegal use of a procedure name in an expression, possibly a function call missing parenthesis.   [GET_LEN]
  write(*,*) p10%get_len() 
-----------------^
compilation aborted for C:\Users\Nicholas\Documents\pdt_bug\p_prog_0.f90 (code 1)

I do not think the error message is correct. Is this second issue fixed as well?

Similar code without PDTs compiled and ran OK (see below).

Regards

Nick

Working code without PDT:

module p_module
  implicit none
  type :: p_type
     integer :: len_p = 10
   contains
     procedure :: get_len => get_p_len
  end type p_type
contains
  integer function get_p_len(this)
    class(p_type), intent(in) :: this
    get_p_len = this%len_p
  end function get_p_len
end module p_module
program p_prog
  use p_module
  implicit none
  type(p_type) :: p10
  write(*,'*) p10%get_len() 
end program p_prog

 

0 Kudos
Steven_L_Intel1
Employee
322 Views

Sorry, looks as if I missed the second problem. It still gets an error - I will pass this on to the developers. Issue ID is DPD200364022.

0 Kudos
Steven_L_Intel1
Employee
322 Views

The second problem should also be fixed in Update 2.

0 Kudos
Reply