- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ifx and ifort compilers fail to detect the out of bounds access for zero sized allocatable array.
Gfortran manages to detect it.
ifx version 2024.2.1
main.f90
program main
integer, allocatable :: a(:)
allocate(a(0))
a(2) = 5
write(*,*) size(a)
end program
Ifx fails to detect the error
ifx main.f90 -check all; ./a.out
0
Gfortran correctly detect the error
gfortran main.f90 --check=all; ./a.out
At line 6 of file main.f90
Fortran runtime error: Index '2' of dimension 1 of array 'a' above upper bound of 0
Error termination. Backtrace:
#0 0x7f3e38025cda in ???
#1 0x7f3e380267d9 in ???
#2 0x7f3e38026d69 in ???
#3 0x40131d in ???
#4 0x40140d in ???
#5 0x7f3e37c2a33f in ???
#6 0x7f3e37c2a408 in ???
#7 0x4010e4 in _start
at ../sysdeps/x86_64/start.S:115
#8 0xffffffffffffffff in ???
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is a known bug CMPLRLLVM-59156 which has already been fixed. The fix will be available in a future release.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is a known bug CMPLRLLVM-59156 which has already been fixed. The fix will be available in a future release.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page