- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifx (2023.0.0 20221201) aborts with an ICE, classical ifort (2021.8.0 20221119) compiles but segfaults. (The code is boiled down from a pretty printer routine for debug purposes.)
program select_rank
implicit none
real :: x
integer :: y
x = 4.56
y = 5
call p(y)
call p((nint(x)))
call p(nint(x))
call p(fun(x))
contains
function fun(x) result(y)
integer :: y
real, intent(in) :: x
y = nint(x)
end function fun
subroutine p(v)
class(*), dimension(..), intent(in) :: v
select rank (v)
rank (0)
select type (v)
type is (integer)
print *, 'rank 0', v
end select
rank default
print *, 'rank not supported'
end select
end subroutine p
end program select_rank
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ouch, a bug for both ifx and ifort. I'll write it up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Ron_Green wrote:
Ouch, a bug for both ifx and ifort. I'll write it up.
Those compilers are not alone
Anyway, thanks for taking care.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for sending this to us. the bug ID is CMPLRLLVM-43747
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a variation, which also fails. I post it as the first testcase runs fine with current gnu fortran, but this new one fails with gfortran as well.
module mod
implicit none
private
type, public :: t
integer :: i = 65
contains
procedure :: get
end type t
contains
pure function get(self) result(i)
integer :: i
class(t), intent(in) :: self
i = self%i
end function get
end module mod
program select_rank_tbproc
use mod
implicit none
type(t) :: x
class(t), pointer :: y
allocate(y, source=t(73))
call p(x%get()) ! fine
call p(y%get()) ! segfault
deallocate(y)
contains
subroutine p(v)
class(*), dimension(..), intent(in) :: v
select rank (v)
rank (0)
select type (v)
type is (integer)
print *, 'rank 0', v
end select
rank default
print *, 'rank not supported'
end select
end subroutine p
end program select_rank_tbproc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! I added it to the bug report.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just confirmed the fix for this bug is in the 2024.1.0 compiler.

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