Observed issues › fuzz/165-cce19
ftn: internal compiler error for lastprivate(conditional:) on a parallel loop in a target region
Legality: not independently confirmed. no independent review yet How this is checked
Same issue as fuzz/1540-afar; this program is another reproducer of it.
Affected variants
| Compiler | MI300A gfx942 unified memory (XNACK 1) | MI300A gfx942 copy (XNACK 0) | MI250X gfx90a copy (XNACK 0) | MI300X gfx942 copy (XNACK 0) | MI350X gfx950 copy (XNACK 0) | A100 sm_80 separate memory | A100 sm_80 managed memory |
|---|---|---|---|---|---|---|---|
| AFAR 24.3.0 | fails another way | fails another way | unknown not run | fails another way | fails another way | n/a | n/a |
| CCE 19.0.0 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 20.0.2 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.3 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.4 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| NVHPC 25.11 | n/a | n/a | n/a | n/a | n/a | fails another way | fails another way |
| NVHPC 26.9 | n/a | n/a | n/a | n/a | n/a | fails another way | fails another way |
| GCC 16.2.0 | correct | correct | correct | correct | correct | correct | n/a |
"behaves incorrectly" / "not supported": this issue, confirmed in up to four environments (another build directory, another node, a repeat). "fails another way": a different failure, not counted as this issue. "unknown": not run there, or the runs disagree.
Messages
| Result | Compiler and GPU | Message |
|---|---|---|
| behaves incorrectly | CCE 19.0.0, MI300A unified CCE 19.0.0, MI300A copy | showWarning: Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable.. Op <<bad conversion d for enum EXP_OP>> Op_MT_GET_MAX_ITER Error message :: unhandled operator Error detected :: File '/workspace/crayftn/pdgcs/v_mt_lower.c', line 7199 Initiated from :: Line 2933 (v_main.c) Optimizer built :: 2025-02-07 (production) File :: fuzz-165-cce19.f90 |
| behaves incorrectly | CCE 20.0.2, MI300A unified CCE 20.0.2, MI300A copy | showWarning: Headers and libraries from cray-libsci/25.09.0 will be ignored because depends on PE_MPICH which is unavailable.. Op <<bad conversion d for enum EXP_OP>> Op_MT_GET_MAX_ITER Error message :: unhandled operator Error detected :: File '/workspace/crayftn/pdgcs/v_mt_lower.c', line 7343 Initiated from :: Line 2937 (v_main.c) Optimizer built :: 2025-11-17 (production) File :: fuzz-165-cce19.f90 |
| behaves incorrectly | CCE 21.0.3, MI300A unified CCE 21.0.3, MI300A copy | showWarning: Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable.. Op <<bad conversion d for enum EXP_OP>> Op_MT_GET_MAX_ITER Error message :: unhandled operator Error detected :: File '/workspace/crayftn/pdgcs/v_mt_lower.c', line 7426 Initiated from :: Line 3018 (v_main.c) Optimizer built :: 2026-07-14 (production) File :: fuzz-165-cce19.f90 |
| behaves incorrectly | CCE 21.0.4, MI300A unified CCE 21.0.4, MI300A copy | showWarning: Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable.. Op <<bad conversion d for enum EXP_OP>> Op_MT_GET_MAX_ITER Error message :: unhandled operator Error detected :: File '/workspace/crayftn/pdgcs/v_mt_lower.c', line 7426 Initiated from :: Line 3018 (v_main.c) Optimizer built :: 2026-09-24 (production) File :: fuzz-165-cce19.f90 |
| fails another way | AFAR 24.3.0, MI300A unified AFAR 24.3.0, MI300A copy AFAR 24.3.0, MI300X AFAR 24.3.0, MI350X | showerror: loc("fuzz-165-cce19.f90":22:11): 'omp.target' op SPMD kernel must capture an 'omp.loop_nest' operation
error: verification of lowering to FIR failed |
| fails another way | NVHPC 25.11, A100 separate NVHPC 25.11, A100 managed NVHPC 26.9, A100 separate NVHPC 26.9, A100 managed | showNVFORTRAN-S-0034-Syntax error at or near : (fuzz-165-cce19.f90: 23) 0 inform, 0 warnings, 1 severes, 0 fatal for fuzz_prog |
Reproduce
CCE 19.0.0, MI300A unified
module load cce/19.0.0 craype-accel-amd-gfx942 rocm/6.4.3 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
CCE 20.0.2, MI300A unified
module load cce/20.0.2 craype-accel-amd-gfx942 rocm/6.4.3 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
CCE 21.0.3, MI300A unified
module load cce/21.0.3 craype-accel-amd-gfx942 rocm/7.2.0 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
CCE 21.0.4, MI300A unified
module load cce/21.0.4 craype-accel-amd-gfx942 rocm/7.2.0 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
GCC 16.2.0, MI300A unified (runs correctly)
export LD_LIBRARY_PATH=$GCC_16_2/lib64:/opt/rocm-7.2.1/lib $GCC_16_2/bin/gfortran -fopenmp -foffload=amdgcn-amdhsa -foffload-options=amdgcn-amdhsa=-march=gfx942 -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (46 lines)
! Minimized by compliance.fuzz_min from fuzz seed 165 (fuzz-1).
! toolchain: cce19 (-O2, HSA_XNACK=1, OMP_TARGET_OFFLOAD=mandatory)
! failure: ice (ice: INTERNAL COMPILER ERROR: "unhandled operator)
! expected: compiles
! observed: internal compiler error: ice: INTERNAL COMPILER ERROR: "unhandled operator
! Legal OpenMP 5.2: offload.engine.prerun.check accepts it (rerun: offload.engine.rules with the
! race rule and the restriction checks, and the AFAR flang front end, not under test here); no
! compiler under test, gfortran or gcc is a legality witness.
! also fails on: afar, cce20, cce21
module fuzz_mod
implicit none
contains
integer function g1(x, y)
!$omp declare target
integer, intent(in) :: x, y
g1 = mod(max((x + y), x), 97)
end function g1
end module fuzz_mod
program fuzz_prog
use omp_lib, only: omp_get_thread_num, omp_is_initial_device
use fuzz_mod, only: g1
implicit none
integer, parameter :: n = 16, m = 2
integer :: o1(n)
integer :: i, j, lp1, t1
logical :: lpar
integer(8) :: cs
o1 = 0
lp1 = 0
lpar = .true.
! fuzz: kernels
!$omp target depend(out: o1)
!$omp parallel do lastprivate(conditional: lp1) private(t1)
do i = n, 1, -1
t1 = 0
if (mod(i, 2) == 1) lp1 = i
end do
!$omp end target
! fuzz: checksum
cs = 0
cs = modulo(cs * 31_8 + int(lp1, 8), 2147483629_8)
do i = 1, n
cs = modulo(cs * 31_8 + int(o1(i), 8), 2147483629_8)
end do
print '(a,i0,a,i0)', 'RESULT checksum=', cs, ' ran_on_host=', 0
end program fuzz_prog
Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page
Expected and observed
Observed where it behaves incorrectly
Warning: Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable.. Op <<bad conversion d for enum EXP_OP>> Op_MT_GET_MAX_ITER Error message :: unhandled operator Error detected :: File '/workspace/crayftn/pdgcs/v_mt_lower.c', line 7199 Initiated from :: Line 2933 (v_main.c) Optimizer built :: 2025-02-07 (production) File :: fuzz-165-cce19.f90
What the specification requires
The specification text this program relies on and the compiler is expected to support.
The same requirement as the issue fuzz/1540-afar.
OpenMP 5.2 §5.4.5 p.115 l.16-19
When the conditional modifier appears on the clause or the list item is an iteration variable of one of the associated loops, if sequential execution of the loop nest would assign a value to the list item then the original list item is assigned the value that the list item would have after sequential execution of the loop nest.
OpenMP 5.2 §17.2 p.340 l.27-30
If the target construct is among the constituent constructs and the list item is not the base variable or base pointer of a list item that appears in a map clause, the effect of the lastprivate clause is as if the same list item appears in a map clause with a map-type of tofrom.
Evidence
Same compiler, one change
- the same parallel do on the host (the target directive removed): AFAR 24.3.0: correct; CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
Control program
module fuzz_mod implicit none contains integer function g1(x, y) !$omp declare target integer, intent(in) :: x, y g1 = mod(max((x + y), x), 97) end function g1 end module fuzz_mod program fuzz_prog use omp_lib, only: omp_get_thread_num use fuzz_mod, only: g1 implicit none integer, parameter :: n = 16, m = 2 integer :: o1(n) integer :: i, j, lp1, t1 logical :: lpar integer(8) :: cs o1 = 0 lp1 = 0 lpar = .true. !$omp parallel do lastprivate(conditional: lp1) private(t1) do i = n, 1, -1 t1 = 0 if (mod(i, 2) == 1) lp1 = i end do cs = 0 cs = modulo(cs * 31_8 + int(lp1, 8), 2147483629_8) do i = 1, n cs = modulo(cs * 31_8 + int(o1(i), 8), 2147483629_8) end do print '(a,i0)', 'RESULT checksum=', cs end program fuzz_prog
Other compilers run it correctly
GCC 16.2.0