- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the following invalid code ICEs with current ifort/ifx:
program bug
implicit none
print *, f([1.])
contains
function f(b)
real, intent(in) :: b(:)
real, pointer :: c(:)
! real :: f(size(b)) ! <-- This would be valid
real :: f(size(c)) ! <-- This is invalid
end
end
I get:
% ifort ifort-bad-specification.f90
ifort-bad-specification.f90(5): warning #6178: The return value of this FUNCTION has not been defined. [F]
function f(b)
-----------^
ifort-bad-specification.f90(9): catastrophic error: **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.
compilation aborted for ifort-bad-specification.f90 (code 1)
and a similar ICE with traceback for ifx. Replacing "pointer" by "allocatable" gives the same crash, as well as other ranks than 1 except for c being a scalar.
Likely an error recovery issue in the compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The ICE melted from this reproducer with the 2024.1 compilers that were released last week.
Please give the new ifx and ifort a try.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reporting this with a great reproducer and the extra insight!
I filed a bug report, CMPLRLLVM-49873. I'll post when a fix is available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One of the compiler engineers took an initial look at this and points out, "By Fortran rules, local variable C is completely undefined. That is, the initial state for a pointer is 'undefined'. Its size would be completely random. So, while it's Not Nice (tm) that we give an ICE at compile time, the program is invalid and likely gives a segfault at runtime."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The ICE melted from this reproducer with the 2024.1 compilers that were released last week.
Please give the new ifx and ifort a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for fixing this!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page