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

Bug Report ICE #5623: passing re/im parts of complex arrays to procedures

jeffhole
Novice
568 Views

Compiler: ifx (IFX) 2024.2.0 20240602 (ifx --version)

OS: Rocky Linux 8.9 (Green Obsidian)

 

Here is the source:

! bug.f90
module test
    implicit none
    contains
    function compute(x,y) result(z)
        real(8), intent(in) :: x(:)
        real(8), intent(in) :: y(:)
        real(8), allocatable :: z(:)
        z = x + y
    end function

    function compute_complex(x,y) result(z)
        real(8), intent(in) :: x(:)
        complex(8), intent(in) :: y(:)
        complex(8), allocatable :: z(:)
        z = compute(x,y%re) + compute(x,y%im)
    end function
end module

Compiling gives this output

ifx -c bug.f90
 #0 0x0000000003191cf7 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3191cf7)
 #1 0x000000000317d7d6 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x317d7d6)
 #2 0x00000000030d03de (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x30d03de)
 #3 0x00000000032351ac (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x32351ac)
 #4 0x00000000032327b6 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x32327b6)
 #5 0x00000000031284ae (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31284ae)
 #6 0x00000000031215f9 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31215f9)
 #7 0x000000000311f012 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x311f012)
 #8 0x0000000003168dc4 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3168dc4)
 #9 0x0000000003169bcf (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3169bcf)
#10 0x000000000316895c (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x316895c)
#11 0x0000000003169bcf (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3169bcf)
#12 0x0000000003168ca2 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3168ca2)
#13 0x0000000003169bcf (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3169bcf)
#14 0x0000000003080b4d (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3080b4d)
#15 0x00000000031d644d (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31d644d)
#16 0x00000000031e0db4 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31e0db4)
#17 0x00000000031e1335 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31e1335)
#18 0x00000000031e3d70 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31e3d70)
#19 0x00000000031e0db4 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31e0db4)
#20 0x00000000031e1335 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31e1335)
#21 0x00000000031deb72 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31deb72)
#22 0x00000000031e0db4 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31e0db4)
#23 0x00000000031de22a (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31de22a)
#24 0x00000000031e0db4 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x31e0db4)
#25 0x0000000003078656 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3078656)
#26 0x0000000003078005 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x3078005)
#27 0x000000000324dd27 (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x324dd27)
#28 0x00007f6fc667bd85 __libc_start_main (/lib64/libc.so.6+0x3ad85)
#29 0x0000000002eb058a (/opt/intel/oneapi/compiler/2024.2/bin/compiler/xfortcom+0x2eb058a)

bug.f90(16): error #5623: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
        z = compute(x,y%re) + compute(x,y%im)
----------------------^
compilation aborted for bug.f90 (code 3)

Workaround

If I surround the re/im arguments with square brackets in the compute_complex() function, the code successfully compiles:

! workaround.f90
module test
    implicit none
    contains
    function compute(x,y) result(z)
        real(8), intent(in) :: x(:)
        real(8), intent(in) :: y(:)
        real(8), allocatable :: z(:)
        z = x + y
    end function

    function compute_complex(x,y) result(z)
        real(8), intent(in) :: x(:)
        complex(8), intent(in) :: y(:)
        complex(8), allocatable :: z(:)
        z = compute(x,[y%re]) + compute(x,[y%im])
    end function
end module

To summarize:

! ref: Line 16 of both files

! won't compile:
z = compute(x,y%re) + compute(x,y%im)

! will compile:
z = compute(x,[y%re]) + compute(x,[y%im])

 

Labels (2)
0 Kudos
1 Solution
Devorah_H_Intel
Moderator
287 Views

The fix is scheduled for the 2025.0 ifx release. 

View solution in original post

0 Kudos
2 Replies
Devorah_H_Intel
Moderator
422 Views

Thank you very much for the report. I tested it internally, and the issue has been escalated to compiler engineering for a fix.


0 Kudos
Devorah_H_Intel
Moderator
288 Views

The fix is scheduled for the 2025.0 ifx release. 

0 Kudos
Reply