Observed issues › oop/gcc-acc-parent-and-member-data-rejected
OpenACC: a structure and its member in one data construct are rejected
Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked
An OpenACC data construct with copyin(x) copy(x%a), the specification's manual deep copy of an allocatable member, is rejected by GCC 16.2 ('mixed component and non-component accesses'). The same deep copy with two enter data directives works. CCE is correct.
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 | n/a | n/a | n/a | n/a | n/a | 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 | correct | correct |
| NVHPC 26.9 | n/a | n/a | n/a | n/a | n/a | correct | correct |
| 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-oop--gcc-acc-parent-and-member-data-rejected.f90:46:29:
46 | !$acc data copyin(x) copy(x%a)
| 1~~
Error: Symbol ‘x’ has mixed component and non-component accesses at (1) |
| not supported | GCC 16.2.0, MI250X | showsite-oop--gcc-acc-parent-and-member-data-rejected.f90:44:29:
44 | !$acc data copyin(x) copy(x%a)
| 1~~
Error: Symbol ‘x’ has mixed component and non-component accesses at (1) |
| not supported | GCC 16.2.0, A100 separate | showsite-oop--gcc-acc-parent-and-member-data-rejected.f90:45:29:
45 | !$acc data copyin(x) copy(x%a)
| 1~~
Error: Symbol ‘x’ has mixed component and non-component accesses at (1) |
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 -fopenacc -foffload=amdgcn-amdhsa -foffload-options=amdgcn-amdhsa=-march=gfx942 -O2 repro.f90 -o repro HSA_XNACK=1 ./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 -fopenacc -foffload=nvptx-none -foffload-options=nvptx-none=-march=sm_80 -foffload-options=nvptx-none=-latomic -O2 repro.f90 -o repro ./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 -h acc -O2 repro.f90 -o repro HSA_XNACK=1 ./repro
Program (57 lines)
! # Finding (fortran-oop): OpenACC data copyin(x) copy(x%a): 'Symbol x has mixed component and non-component accesses'
!
! - toolchains and modes that fail: gcc_g90 (GCC 16.2 (gfx90a): copy), gcc_sm80 (GCC 16.2 (sm_80): copy); -O2
! - build: gfortran -fopenacc -foffload=amdgcn-amdhsa -foffload-options=amdgcn-amdhsa=-march=gfx90a -O2 (gcc_g90); -fopenacc
! -foffload=nvptx-none -foffload-options=nvptx-none=-march=sm_80 (gcc_sm80)
! - failure: rejected (diagnostic)
! - observed: `Error: Symbol 'x' has mixed component and non-component accesses`
! - expected: compiles; `r1= 4160`
! - rule: OpenACC 3.4 §2.7.1 p.50 l.1711-1713 (a derived-type variable's allocatable members' data are not copied with it) and
! §2.6.4 p.43 l.1449-1458 (a member in a data clause is attached): the manual deep copy the specification describes
! - same-compiler control: the same deep copy by enter data copyin(x) then copyin(x%a) (oop-acc-deep-enterexit): correct
! - other families: CCE 19, 20, 21 correct in both modes
! - gate and confirmer: 2 cells, 2 confirmed in the gate's four environments (a-d; results/oop/main/gate_reruns*.jsonl); confirmer
! (results/oop/main/confirm.jsonl): compiler_bug (R11-compile-rejection) 2
! - programs (1): oop-acc-deep-data (offload/engine/oop_gen.py; this file is the first one)
! - legality: for the gcc cells: the rules (offload.engine.rules, with the fortran-oop restrictions) and AFAR's flang front end
! (-fsyntax-only) and a CCE compile and NVHPC 26.9 nvfortran (compile only) (tools/campaigns/oop.py legality,
! results/oop/main/legality.json)
module oop_m
implicit none
integer, parameter :: n = 64
type vec
integer :: n = 0
integer, allocatable :: a(:)
end type vec
end module oop_m
program oop
use openacc
use oop_m
implicit none
integer :: host_flag
logical :: ok
integer :: r1
type(vec) :: x
integer :: i
host_flag = 1
!$acc serial copy(host_flag)
host_flag = merge(1, 0, acc_on_device(acc_device_host))
!$acc end serial
allocate(x%a(n))
x%n = n
do i = 1, n
x%a(i) = i
end do
!$acc data copyin(x) copy(x%a)
!$acc parallel loop
do i = 1, n
x%a(i) = 2 * x%a(i)
end do
!$acc end data
r1 = sum(x%a)
ok = .true.
ok = ok .and. (r1 == 4160)
print '(a,i0)', 'r1= ', r1
print '(a,i0,a,a)', 'RESULT ran_on_host=', host_flag, ' check=', merge('pass', 'fail', ok)
end program oop
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
site-oop--gcc-acc-parent-and-member-data-rejected.f90:46:29:
46 | !$acc data copyin(x) copy(x%a)
| 1~~
Error: Symbol ‘x’ has mixed component and non-component accesses at (1)What the specification requires
The specification text this program relies on and the compiler is expected to support.
OpenACC 3.4 §2.7.1 p.50 l.1711-1713
OpenACC 3.4 §2.6.4 p.43 l.1449-1458
Evidence
Other compilers run it correctly
CCE 19.0.0, CCE 20.0.2, CCE 21.0.3, CCE 21.0.4, NVHPC 25.11, NVHPC 26.9