OffTarget

Observed issues › fuzz/b3-9-afar

Appears to behave incorrectlyCompiler crash · Fortran · OpenMP · Open

amdflang: "verification of lowering to FIR failed" for nontemporal on an assumed-shape dummy

Legality: not independently confirmed. no independent review yet How this is checked

Same issue as afar-nontemporal-assumed-shape-ice; this program is another reproducer of it.

Affected variants

CompilerMI300A 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.0behaves incorrectlybehaves incorrectlyunknown
not run
behaves incorrectlybehaves incorrectlyn/an/a
CCE 19.0.0correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 20.0.2correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.3correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.4correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
NVHPC 25.11n/an/an/an/an/afails another wayfails another way
NVHPC 26.9n/an/an/an/an/afails another wayfails another way
GCC 16.2.0correctcorrectcorrectcorrectcorrectcorrectn/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

ResultCompiler and GPUMessage
behaves incorrectlyAFAR 24.3.0, MI300A unified
AFAR 24.3.0, MI300A copy
AFAR 24.3.0, MI300X
AFAR 24.3.0, MI350X
show
error: loc("fuzz-b3-9-afar.f90":68:13): 'omp.simd' op operand #0 must be variadic of OpenMP-compatible variable type, but got '!fir.box<!fir.array<?x?xi32>>'
error: verification of lowering to FIR failed
fails another wayNVHPC 25.11, A100 separate
NVHPC 25.11, A100 managed
show
NVFORTRAN-S-0034-Syntax error at or near identifier nontemporal (fuzz-b3-9-afar.f90: 68)
NVFORTRAN/x86-64 Linux 25.11-0: compilation completed with severe errors
fails another wayNVHPC 26.9, A100 separate
NVHPC 26.9, A100 managed
show
NVFORTRAN-S-0034-Syntax error at or near identifier nontemporal (fuzz-b3-9-afar.f90: 68)
NVFORTRAN/x86-64 Linux 26.9-0: compilation completed with severe errors

Reproduce

AFAR 24.3.0, MI300A unified

$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

CCE 19.0.0, MI300A unified (runs correctly)

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
Program (96 lines)
! Minimized by compliance.fuzz_min from fuzz seed 9 (fuzz-3).
! toolchain: afar (-O2, HSA_XNACK=1, OMP_TARGET_OFFLOAD=mandatory)
! failure: ice (afar FIR verification: 'omp.simd' op operand #0 must be variadic of OpenMP-compatible variable type, but got
!   '!fir.box<!fir.array<?x?xi32>>')
! expected: compiles
! observed: internal compiler error: ice: error: verification of lowering to FIR failed
! Legal OpenMP 5.2: offload.engine.rules accepts it (offload.engine.prerun.check, rerun: with the
!   race rule and the restriction checks); NVHPC is no witness: it rejects it
!   (NVFORTRAN-S-0034-Syntax error at or near identifier nontemporal); the
!   check's other witness, the AFAR flang front end, is the compiler under test and is not counted;
!   no gfortran or gcc is a legality witness.
program fuzz_prog
  use omp_lib, only: omp_get_default_device, omp_is_initial_device
  implicit none
  integer, parameter :: n = 200, m = 8
  type :: rec_t
    integer :: a(n)
    integer, allocatable :: q(:)
    integer, pointer :: pc(:)
  end type rec_t
  type(rec_t) :: dr
  integer, allocatable, target :: ia(:)
  integer :: ib(n)
  integer, allocatable :: ic(:, :)
  integer, pointer :: o1(:, :)
  integer, pointer :: o2(:)
  integer, target :: o1t(n, m)
  integer, target :: o2t(n)
  integer :: i, j, r1a, r1b, hf1, r2a, dev
  integer(8) :: cs
  allocate(ia(n))
  allocate(ic(n, m))
  allocate(dr%q(n))
  o1 => o1t
  o2 => o2t
  do i = 1, n
    ia(i) = mod(i * 4 + 15, 1009) - 376
  end do
  do i = 1, n
    ib(i) = mod(i * 3 + 7, 30011) - 3238
  end do
  do j = 1, m
    do i = 1, n
      ic(i, j) = mod((i + 1 * j) * 60 + 5, 101) - 34
    end do
  end do
  do i = 1, n
    dr%a(i) = mod(i * 35 + 38, 97) - 36
    dr%q(i) = mod(i * 10 + 45, 211) - 86
  end do
  o1 = 0
  o2 = 0
  r1a = 2
  r1b = 3
  hf1 = 0
  r2a = 4
  dev = omp_get_default_device()
  ! fuzz: kernels
  ! fuzz: checksum
  cs = 0
  cs = modulo(cs * 31_8 + int(r1a, 8), 2147483629_8)
  cs = modulo(cs * 31_8 + int(r1b, 8), 2147483629_8)
  do j = 1, m
    do i = 1, n
      cs = modulo(cs * 31_8 + int(o1t(i, j), 8), 2147483629_8)
    end do
  end do
  cs = modulo(cs * 31_8 + int(r2a, 8), 2147483629_8)
  do i = 1, n
    cs = modulo(cs * 31_8 + int(o2t(i), 8), 2147483629_8)
  end do
  print '(a,i0,a,i0)', 'RESULT checksum=', cs, ' ran_on_host=', max(hf1, 0)
contains
  subroutine kp1(ib, o1, dr, zopt)
    integer, intent(in) :: ib(n)
    integer, intent(inout) :: o1(:, :)
    type(rec_t), intent(inout) :: dr
    integer, intent(in), optional :: zopt(:)
    !$omp target
    do i = n, 1, -1
      !$omp simd nontemporal(o1)
      do j = m, 1, -1
      end do
      !$omp end simd
    end do
    !$omp end target
  end subroutine kp1
  subroutine kp2(ia, ib, ic, o2, dr, zopt)
    integer, allocatable, intent(inout) :: ia(:)
    integer, intent(in) :: ib(n)
    integer, allocatable, intent(inout) :: ic(:, :)
    integer, intent(inout) :: o2(:)
    type(rec_t), intent(inout) :: dr
    integer, intent(in), optional :: zopt(:)
  end subroutine kp2
end program fuzz_prog

Source in the repository

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

error: loc("fuzz-b3-9-afar.f90":68:13): 'omp.simd' op operand #0 must be variadic of OpenMP-compatible variable type, but got '!fir.box<!fir.array<?x?xi32>>'
error: verification of lowering to FIR failed

What the specification requires

The specification text this program relies on and the compiler is expected to support.

The same requirement as the issue afar-nontemporal-assumed-shape-ice.

OpenMP 5.2 §10.4.1 p.236 l.21-22

The nontemporal clause specifies that accesses to the storage locations to which the list items refer have low temporal locality across the iterations in which those storage locations are accessed.

OpenMP 5.2 §10.4.1 p.236 l.23-24

The list items of the nontemporal clause may also appear as list items of data-environment attribute clauses.

Evidence

Other compilers run it correctly

CCE 19.0.0, CCE 20.0.2, CCE 21.0.3, CCE 21.0.4, GCC 16.2.0