- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consider this simple program, whose core is a relatively simple loop:
program test
implicit none
integer :: NSYM, NMIDV
NSYM = 4
NMIDV = 6
call sub(NSYM,NMIDV)
end program test
subroutine sub(NSYM,NMIDV)
implicit none
integer :: NSYM, NMIDV
integer :: NOW(2,NSYM,NMIDV), NOCSF(NSYM,NMIDV,NSYM), NCSF(NSYM)
integer :: ISYTOT, MV, ISYUP, N, ISYDWN
integer, parameter :: MUL(8,8) = reshape([1,2,3,4,5,6,7,8, &
2,1,4,3,6,5,8,7, &
3,4,1,2,7,8,5,6, &
4,3,2,1,8,7,6,5, &
5,6,7,8,1,2,3,4, &
6,5,8,7,2,1,4,3, &
7,8,5,6,3,4,1,2, &
8,7,6,5,4,3,2,1],[8,8])
NOW(:,:,:) = reshape([4,1,0,0,0,0,2,0,0,3,4,0,4,0,0,0,4,6,0,0,0,0,2,0,1,3,0,0,0,0,2,0,0,8,2,0,1,0,0,0,1,6,0,0,0,0,0,0], &
[2,NSYM,NMIDV])
NCSF(:) = 0
do ISYTOT=1,NSYM
do MV=1,NMIDV
do ISYUP=1,NSYM
ISYDWN = MUL(ISYTOT,ISYUP)
N = NOW(1,ISYUP,MV)*NOW(2,ISYDWN,MV)
NOCSF(ISYUP,MV,ISYTOT) = N
NCSF(ISYTOT) = NCSF(ISYTOT)+N
end do
end do
end do
write(6,'(a,100(x,i2))') 'NCSF',NCSF
end subroutine sub
With ifx 2024.1 I get wrong results (all zeros) with -heap-arrays and -O2:
$ ifx --version
ifx (IFX) 2024.1.0 20240308
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
$ ifx -heap-arrays -O2 a.f90 && ./a.out
NCSF 0 0 0 0
$ ifx -heap-arrays -O0 a.f90 && ./a.out
NCSF 37 28 20 20
$ ifx -O2 a.f90 && ./a.out
NCSF 37 28 20 20
while the 2024.0 version works as expected:
$ /opt/intel/oneapi/compiler/2024.0/bin/ifx --version
ifx (IFX) 2024.0.2 20231213
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.
$ /opt/intel/oneapi/compiler/2024.0/bin/ifx -heap-arrays -O2 a.f90 && ./a.out
NCSF 37 28 20 20
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Jellby1 yes, I see this bug even in our main branch. I think it's a change in the backend optimization phases that Intel has added to LLVM. I am in contact with that team and am writing a bug report. Let me see if we can find a workaround until we can get a fix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
bug ID is CMPLRLLVM-58133
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked the status, and it is fixed in the 2025.0 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