- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I reproduced the issue internally. Thank you for the report. This case has been escalated to compiler engineering.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I reproduced the issue internally. Thank you for the report. This case has been escalated to compiler engineering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @JFH for checking this against ifort. Good thing to know.
You're welcome, @Devorah_H_Intel! Glad to help!
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page