Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
25 Views

Internal compiler error on ifort (IFORT) 19.0.0.117 20180804

Hello everyone!

The following code results in an internal compiler error using ifort (IFORT) 19.0.0.117 20180804, but only when including debug symbols via -g, e.g. using ifort -g -c source.f90

module some
  type :: type_t
    contains
      procedure :: bar
  end type

  contains
    subroutine bar(this)
      class(type_t)   :: this
    end subroutine
      
    function foobar(var)
      class(type_t), intent(in) :: var
      call var%bar
    end function
end module
    
function foo(arr)
  integer, intent(in) :: arr(:)
  integer             :: foo(size(arr))
end function

I tried to minimize the code as much as possible, but the warnings connected to the compilation are apparently unrelated to the problem which originates in the last but one line. Is there any workaround I can do to compile this code without changing it semantically? Thanks!

0 Kudos
2 Replies
Highlighted
Black Belt Retired Employee
25 Views

Have you tried a newer compiler? 19.0.5 is current. I don't have Linux, but I tried this on Windows with 19.0.5 and /debug and it compiled. Debug support is different enough on the platforms, though, that this doesn't necessarily mean anything.

0 Kudos
Highlighted
Valued Contributor III
25 Views

bugger,Deb wrote:

.. Is there any workaround I can do to compile this code without changing it semantically? ..

What do you mean by not changing the code "semantically"?  You can contact Intel Support, if you are able to, and try to get more insight on the insidious "internal compiler error" (ICE) which, as you know, is always a compiler bug.  That might then point you toward your options to workaround the ICE.  If not, you can try to fix your non-conforming function 'foobar' and declare the function result and define it also as shown below which should then allow your compiler to avoid the ICE:

   function foobar(var) result(r)
      class(type_t), intent(in) :: var
      integer :: r
      call var%bar
      r = 42
   end function

Or you can switch to another different compiler like the latest of Intel Fortran.

 

0 Kudos