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

Internal error: interface with same name as derived type

Robert_Hayward
Beginner
503 Views
Greetings Fortran enthusiasts!

I ran into an internal error in the most recent version of ifort.
$ ifort -c obj_fail.f90
obj_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 --version
ifort (IFORT) 12.1.5 20120612
Copyright (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:[fortran]!! 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[/fortran] 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
0 Kudos
3 Replies
Anonymous66
Valued Contributor I
503 Views
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
0 Kudos
Robert_Hayward
Beginner
503 Views
Thanks for the quick reply!
0 Kudos
Anonymous66
Valued Contributor I
503 Views
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
0 Kudos
Reply