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

Bug Report ICE: "catastrophic error" with ieee_arithmetic module's ieee_value (ifx 2024.2)

jeffhole
초보자
1,951 조회수

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

OS Rocky Linux 8.9 (Green Obsidian)

 

I encountered an interesting ICE when setting double precision complex number arrays to "NaN". I don't know if this is a misuse of the ieee_arithmetic's ieee_value(), or if it is standard-compliant, but here it is:

 

! file: test.f90
program main
    use, intrinsic :: ieee_arithmetic, only: ieee_value, ieee_quiet_nan
    implicit none
    complex(8), allocatable :: x(:)

    allocate(x(3))
    x = cmplx(ieee_value(x%re,ieee_quiet_nan), ieee_value(x%im,ieee_quiet_nan), kind=8)

    print *, x%im
end program

 

Compiling on the command line:

 

ifx test.f90

 

I get this compiler error message:

 

test.f90(8): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
    x = cmplx(ieee_value(x%re,ieee_quiet_nan), ieee_value(x%im,ieee_quiet_nan), kind=8)
^
test.f90(8): catastrophic error: Internal Compiler Error: Ref module: ffe_aexpr.c
compilation aborted for test.f90 (code 1)

 

Workaround

 I found a workaround which is to only pass a single value of x for the first argument of ieee_value():

 

! file: workaround.f90
program main
    use, intrinsic :: ieee_arithmetic, only: ieee_value, ieee_quiet_nan
    implicit none
    complex(8), allocatable :: x(:)

    allocate(x(3))
    x = cmplx(ieee_value(x(1)%re,ieee_quiet_nan), ieee_value(x(1)%im,ieee_quiet_nan), kind=8)

    print *, x%im
end program

 

This seems like the right thing to do. I wanted to share this solution and give the compiler team code to reproduce the error. Thanks!

레이블 (2)
0 포인트
1 솔루션
Devorah_H_Intel
중재자
1,787 조회수

I reproduced the issue internally. Thank you for the report. This case has been escalated to compiler engineering.


원본 게시물의 솔루션 보기

0 포인트
4 응답
JFH
새로운 기여자 I
1,844 조회수

@jeffhole's test.f90 program compiles and runs correctly with ifort. If one changes the kind 8 to either 4 or 16 it still crashes with ifx and runs correctly with ifort.

0 포인트
Devorah_H_Intel
중재자
1,788 조회수

I reproduced the issue internally. Thank you for the report. This case has been escalated to compiler engineering.


0 포인트
jeffhole
초보자
1,782 조회수

Thanks @JFH for checking this against ifort. Good thing to know.

 

You're welcome, @Devorah_H_Intel! Glad to help!

0 포인트
jeffhole
초보자
1,117 조회수

I tested this under the latest release 2025.2.0 and the issue is still showing. I looked at the support ticket opened on my behalf at Intel Support and it's status is "closed: final". Is there a status update on this?

Thank you!

P.S. The support ticket is #06274899, created 2024/07/01 13:09 and last updated 2024/12/19 00:48.

0 포인트
응답