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

IFX 2023.0.0 ICE using varible format expressions on Windows

fortrandave
New Contributor I
672 Views

Greetings,

Please consider the following code which generates an ICE in IFX but works fine in Classic 2023.0.0.  Can this be fixed in the next point release?

! Examples work fine in Classic using::
! Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on
! Intel(R) 64, Version 2021.8.0 Build 20221119_000000
!
! Examples that produce ICEs with IFX using:
! Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version
! 2023.0.0 Build 20221201
!
! xfortcom: Fatal: There has been an internal compiler error (C0000005).
module mymodule_m
implicit none

contains

subroutine incarray_file(width, iitems, iplaces)
integer, intent(in) :: width
integer, intent(in), optional :: iitems, iplaces
real :: array(8)
integer :: items, places

items  = size(array)
places = 2

601	format(z<width>.<width>) !Comment for ICE 1
602	format(o<width>.<width>) !Comment for ICE 1
603	format(f<width>.<width>) !Comment for ICE 1
    
if(present(iplaces))then
    write(*, '(<items>(f0.<iplaces>,","))')array !Comment for ICE 2
else
    write(*, '(<items>(f0.<places>,","))')array
endif

if(present(iitems))then
    write(*, '(<iitems>(f0.<iplaces>,","))')array(1:items) !Comment for ICE 3
else
    write(*, '(<items>(f0.<places>,","))')array(1:items)
endif

end subroutine incarray_file

end module mymodule_m
!*******************************************************************************
program variable_format_ice
implicit none

end program variable_format_ice

Thanks,
Dave

5 Replies
Barbara_P_Intel
Moderator
629 Views

Thanks for reporting this and for the great reproducer. It also ICEs on Linux.

I filed a bug on your behalf, CMPLRLLVM-45008. I'll keep you posted on its progress to a fix.



0 Kudos
fortrandave
New Contributor I
559 Views

Again, you're welcome!  And thanks RE the reproducer.  I worked at trying to make it small and self-contained.  Of the three recent issues I posted, this one has the most impact so I'm looking forward to a fix.  I'm expecting I'll be able to compare my ifx compiled application against classic results later this year.

 

I'll watch this thread for updates.

0 Kudos
andrew_4619
Honored Contributor II
544 Views

Rather than using the non standard format with <width>  when not make some std Fortran. A simple function that build an allocatable string that has been build from the function parameters would be one  way of doing it.

0 Kudos
Barbara_P_Intel
Moderator
382 Views

I just successfully compiled this reproducer with ifx 2024.0 that was released this week. @fortrandave, please try this updated compiler.

 

 

fortrandave
New Contributor I
358 Views

Thanks for the update -- that's great news!  Congrats on the 2024.0 release!

0 Kudos
Reply