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

ICE when using structure constructor in user-defined constructor

Sean_S_2
Beginner
817 Views

ifort seems to have trouble with the following code:

module test_constructor_name

implicit none

type :: foo
   integer :: a(1)
end type foo

interface foo
   module procedure new_foo
end interface

contains

  function new_foo(b, c) result(the_foo)
    integer, intent(in) :: b(1), c
    type(foo) :: the_foo
    the_foo = foo(b + c)
  end function new_foo

end module test_constructor_name

Compiling this with a simple "ifort -c" will show the error:

test_constructor_name.F90(18): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
    the_foo = foo(b + c)
^
[ Aborting due to internal error. ]
compilation aborted for test_constructor_name.F90 (code 1)

 

This bug seems to have been around for a while, but is still in version 14.0:

Version 12.1.5.339 Build 20120612

Version 14.0.2.144 Build 20140120

0 Kudos
2 Replies
Kevin_D_Intel
Employee
817 Views

Thank you for reporting this error also and for the convenient reproducer. I reproduced this error and forwarded it to Developers (see internal tracking id below) and will keep you posted on the status of a fix.

(Internal tracking id: DPD200255190)

0 Kudos
Sean_S_2
Beginner
817 Views

This appears to have been addressed in 15.0.0

0 Kudos
Reply