Observed issues › fuzz/gcc-target-simd-map-nontemporal-rejected
The same array in map and nontemporal clauses of a Fortran target simd construct is rejected
Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked
On target simd, map applies to the target leaf and nontemporal to the simd leaf. GCC 16.2's Fortran front end rejects an array named in both ("present on multiple clauses") for both offload targets; the C form compiles and runs. Without nontemporal the program compiles and runs correctly.
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 | correct | correct | unknown not run | correct | correct | n/a | n/a |
| CCE 19.0.0 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 20.0.2 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.3 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.4 | correct | correct | 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 | not supported | not supported | not supported | not supported | not supported | not supported | 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 |
|---|---|---|
| not supported | GCC 16.2.0, MI300A unified GCC 16.2.0, MI300A copy GCC 16.2.0, MI300X GCC 16.2.0, MI350X | showsite-fuzz--gcc-target-simd-map-nontemporal-rejected.f90:40:48:
40 | !$omp target simd map(tofrom: o) nontemporal(o)
| 1
Error: Symbol ‘o’ present on multiple clauses at (1) |
| not supported | GCC 16.2.0, MI250X GCC 16.2.0, A100 separate | showsite-fuzz--gcc-target-simd-map-nontemporal-rejected.f90:32:48:
32 | !$omp target simd map(tofrom: o) nontemporal(o)
| 1
Error: Symbol ‘o’ present on multiple clauses at (1) |
| 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 identifier nontemporal (site-fuzz--gcc-target-simd-map-nontemporal-rejected.f90: 32) 0 inform, 0 warnings, 1 severes, 0 fatal for target_simd_map_nontemporal |
Reproduce
GCC 16.2.0, MI300A unified
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
GCC 16.2.0, A100 separate
export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=$GCC_16_2/lib64 $GCC_16_2/bin/gfortran -fopenmp -foffload=nvptx-none -foffload-options=nvptx-none=-march=sm_80 -foffload-options=nvptx-none=-latomic -O2 repro.f90 -o repro OMP_TARGET_OFFLOAD=mandatory ./repro
AFAR 24.3.0, MI300A unified (runs correctly)
$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (47 lines)
! # Finding (GCC 16.2, fuzz sample): the same array in map and nontemporal of target simd is rejected (Fortran)
!
! - toolchains: gcc_g90 (GCC 16.2.0, AMD Instinct MI250X gfx90a, Tioga) and gcc_sm80 (GCC 16.2.0, NVIDIA A100 sm_80, wingtip);
! separate memory only; -O2
! - build: gfortran -fopenmp -foffload=amdgcn-amdhsa -foffload-options=amdgcn-amdhsa=-march=gfx90a -O2 (gcc_g90);
! -foffload=nvptx-none -foffload-options=nvptx-none=-march=sm_80 -foffload-options=nvptx-none=-latomic -O2 (gcc_sm80)
! - failure: rejected: present on multiple clauses
! - observed: `Error: Symbol 'o' present on multiple clauses at (1)` at the nontemporal clause, on both targets; the C form
! (results/parity/probes-r2/nontemporal_c.c) compiles and runs correctly on both (mandatory pass 5 of 5; unset pass 5 of 5)
! - expected: compiles; prints `bad= 0` and `RESULT ran_on_host=0 check=pass`
! - rule: on a combined construct each clause applies to the leaf constructs that allow it (5.2 §17.2 p.341): map to target,
! nontemporal to simd; nontemporal is no data-sharing attribute clause, so the map restriction "A list item cannot appear in both
! a map clause and a data-sharing attribute clause on the same construct" does not apply.
! - same-compiler control (compiles; correct, gcc_sm80: mandatory pass 5 of 5; unset pass 5 of 5; gcc_g90: mandatory pass 5 of 5;
! unset pass 5 of 5 (results/parity/<machine>/<tc>/probes.jsonl)): the same construct without nontemporal
! (controls/gcc-target-simd-map-nontemporal-control.f90).
! - GCC's documentation: no row of libgomp.texi's tables names it (undocumented; nontemporal is OpenMP 5.0's).
! - other families: AFAR and CCE 19/20/21/21.0.4 run this file correctly in both memory modes; NVHPC 25.11/26.9 fail it another way
! (site matrix). The site's finding matrix runs this file on every compiler.
! - fuzz programs (44 cells (22 gcc_g90, 22 gcc_sm80); gate: confirmed 44; confirmer: needs_human (R12b-compile-undecided) 35,
! compiler_bug (R11-compile-rejection) 9): b0:227, b0:294, c1:1350, c1:1688, c1:1721, c1:18, c1:209, c1:227, c1:427, c1:469,
! s1:1336, s1:1608, s1:2321, s1:327, s1:3745, s1:4530, s1:9979, x0-alloc:191, x0-declare:70, x0-multitu:111, x0-multitu:227,
! x0-types:220
! - legality: two witnesses that are neither GCC nor a compiler this finding is about, offload.engine.rules and AFAR flang's
! front end,
! accept this file and its control (offload.engine.prerun.check; results/parity/tioga/results/parity/legality.jsonl) and the fuzz
! programs (the campaign's legality gate; its base-language check, gfortran -std=f2008 without OpenMP, is a syntax check of the
! base language only and no witness). GCC is a compiler under test only and never a legality witness.
program target_simd_map_nontemporal
use omp_lib, only: omp_is_initial_device
implicit none
integer, parameter :: n = 64
integer :: o(n), i, bad, host_flag
o = 0
host_flag = 1
!$omp target map(tofrom: host_flag)
host_flag = merge(1, 0, omp_is_initial_device())
!$omp end target
! map applies to the target leaf, nontemporal to the simd leaf
!$omp target simd map(tofrom: o) nontemporal(o)
do i = 1, n
o(i) = 2 * i
end do
bad = count(o /= [(2 * i, i = 1, n)])
print '(a,i0)', 'bad= ', bad
print '(a,i0,a,a)', 'RESULT ran_on_host=', host_flag, ' check=', merge('pass', 'fail', bad == 0)
end program target_simd_map_nontemporal
Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page
Expected and observed
Expected
check=pass
Observed where it behaves incorrectly
site-fuzz--gcc-target-simd-map-nontemporal-rejected.f90:40:48:
40 | !$omp target simd map(tofrom: o) nontemporal(o)
| 1
Error: Symbol ‘o’ present on multiple clauses at (1)What the specification requires
The specification text this program relies on and the compiler is expected to support.
OpenMP 5.2 §17.2 p.341
Evidence
Same compiler, one change
- the same construct without nontemporal: not run yet
Control program
! Control of fuzz/gcc-target-simd-map-nontemporal-rejected.f90: the same construct without nontemporal (compiles; correct ! on gcc_g90 and gcc_sm80). program target_simd_map_nontemporal use omp_lib, only: omp_is_initial_device implicit none integer, parameter :: n = 64 integer :: o(n), i, bad, host_flag o = 0 host_flag = 1 !$omp target map(tofrom: host_flag) host_flag = merge(1, 0, omp_is_initial_device()) !$omp end target ! map applies to the target leaf, nontemporal to the simd leaf !$omp target simd map(tofrom: o) do i = 1, n o(i) = 2 * i end do bad = count(o /= [(2 * i, i = 1, n)]) print '(a,i0)', 'bad= ', bad print '(a,i0,a,a)', 'RESULT ran_on_host=', host_flag, ' check=', merge('pass', 'fail', bad == 0) end program target_simd_map_nontemporal
Other compilers run it correctly
AFAR 24.3.0, CCE 19.0.0, CCE 20.0.2, CCE 21.0.3, CCE 21.0.4