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

Fortran regression ICE in Intel(R) 64, Version 2021.12.0

Juergen_R_R
Valued Contributor I
474 Views

There is a regression with the Intel oneAPI 2024 Fortran compiler Intel(R) 64, Version 2021.12.0,

which had been working in 2021.10.0, and it also works with ifx (as well as gfortran and nagfor).

Compilation leads to an internal compiler error (ICE).

module m1
  implicit none
  private
  type :: t1
    integer, dimension(:), allocatable :: flst
    integer :: n_in = 0
  end type t1
  type :: t2
    type(t1), dimension(:), allocatable :: tt
    integer :: n_in = 0
  contains
    procedure :: s1 => t2_s1
  end type t2
contains
   subroutine t2_s1 (rt, ttt)
    class(t2), intent(in) :: rt
    type(t1), intent(out), dimension(:), allocatable :: ttt
    integer :: n_real
    integer :: i_real
    n_real = size (rt%tt)
    allocate (ttt (0))
    do i_real = 1, n_real
       call s3 (i_real, ttt)
    end do
  contains
    subroutine s3 (i_real, ttt)
      integer, intent(in) :: i_real
      type(t1), intent(inout), dimension(:), allocatable :: ttt
      type(t1) :: ttt_tmp
      associate (tt => rt%tt(i_real))
        ttt_tmp = s2 (tt, rt%n_in)
        ttt = [ttt, ttt_tmp]
      end associate
    end subroutine s3
  end subroutine t2_s1
  function s2 (flv1, n_in) result(flv2)
    type(t1), intent(in) :: flv1
    integer, intent(in) :: n_in
    type(t1) :: flv2
    integer :: n
    n = size (flv1%flst)
    allocate (flv2%flst (n))
    flv2%n_in = n_in
  end function s2
end module m1
0 Kudos
6 Replies
jdelia
New Contributor I
465 Views

Dear Juergen_R_R,

Well, at least with:

$ ifx --version
ifx (IFX) 2024.1.0 20240308
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

$ ifx -O2 -error-limit 4 -e03 -fimf-arch-consistency=true -fimf-precision=high -finline-functions -fp-model consistent -fpp -fpe-all=1 -ipo -mavx -mtune=generic -m64 -parallel-source-info=1 -qmkl -qopenmp -qopt-report=3 -standard-semantics -std18 -traceback -WB -warn all -xHost -c testcase-0207.f90
$

Regards,

Jorge.

0 Kudos
Juergen_R_R
Valued Contributor I
464 Views

Yes, I already mentioned that it works with ifx. However, ifx still doesn't work fully with our software. That's the reason why we still have to rely on ifort

0 Kudos
Barbara_P_Intel
Moderator
370 Views

@Juergen_R_R, I also get ICE with the current nightly build with ifort. Since it compiles ok with ifx, it will be hard to get a compiler engineer to look at it with all the other bug fixes going on. The plan is that the last release of ifort is mid 2024.

Do you know that you can mix and match object files and .mod files between ifx and ifort, unless you compile with -ipo? That may help you move along.

 

 

0 Kudos
Juergen_R_R
Valued Contributor I
368 Views

That is very bad news. I think, even 2021.11.0 was ok, so the regression must have happened pretty recently. As ifx still has some major problems and extrapolating from past experience, this means that we probably have to discard Intel compilers for 1-2 years until all the stuff is fixed. At the moment, I'm trying to isolate another problem, where ifx produces wrong code. Mixing code is no option as this cannot be automized.

0 Kudos
Barbara_P_Intel
Moderator
317 Views

I did some poking around. The ifort ICE you reported is a duplicate of another bug. Look for the ICE to melt in 2024.2 available in mid-2024!

 

0 Kudos
Juergen_R_R
Valued Contributor I
316 Views

Barbara, that's great news!! A lot of motivation to invest into debugging for me and my team!

0 Kudos
Reply