Internal error: interface with same name as derived type

Internal error: interface with same name as derived type

Greetings Fortran enthusiasts!
I ran into an internal error in the most recent version of ifort.

$ ifort -c obj_fail.f90obj_fail.f90(30): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance. o = obj(ifunc())^[ Aborting due to internal error. ]compilation aborted for obj_fail.f90 (code 1)$ ifort --versionifort (IFORT) 12.1.5 20120612Copyright (C) 1985-2012 Intel Corporation. All rights reserved.$ which ifort/opt/intel/composer_xe_2011_sp1.11.339/bin/ia32/ifort

'obj_fail.f90' is distilled down to the simplest code that I found to reproduce the error:

!! Filename: obj_fail.f90

!! Description: Produces internal compiler error with ifort 12.1.5 20120612

!! Author: Robert Hayward <...>

!! Created: Tue Jul  3 10:04:41 2012 (+0200)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

MODULE obj_mod

  IMPLICIT NONE
  TYPE :: obj

     INTEGER :: j

  END TYPE obj
  INTERFACE obj

     MODULE PROCEDURE obj_from_int

  END INTERFACE obj
CONTAINS
  TYPE(obj) FUNCTION obj_from_int(i)

    INTEGER, INTENT(in) :: i

    obj_from_int%j = i + 1

  END FUNCTION obj_from_int
  INTEGER FUNCTION ifunc()

    ifunc = 1

  END FUNCTION ifunc
  SUBROUTINE ifort_will_choke_on_this()

    TYPE(obj) :: o

    o = obj(ifunc())

  END SUBROUTINE ifort_will_choke_on_this
END MODULE obj_mod

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! obj_fail.f90 ends here

The error goes away if I change the name of the interface to something else ('obj_func' for example). According to section 3.2.1 of the update 11 release notes:

  • A generic interface may have the same name as a derived type

So this should be okay. (right?)
Thanks for your help,Robert

AttachmentSize
Download obj_fail.f90837 bytes
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello Robert,

We are planning to include a fix for this issue in the next major release which is scheduled for later this year. I will update you when the fix is available.

Regards,
Annalee
Intel Developer Support

Thanks for the quick reply!

This is issue has been fixed in Intel® Fortran Composer XE 2013 which is now available at the Intel® Registration Center.

Regards,
Annalee
Intel Developer Support

Login to leave a comment.