OffTarget

Observed issues › afar-cce19-task-in-target-ice

Appears to behave incorrectlyCompiler crash · Fortran · OpenMP · Open

Constructs documented as unsupported in offload regions (single, masked, task, ordered, scan) give internal compiler errors or device link failures instead of a diagnostic

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

Same issue as cce19-target-parallel-single-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 incorrectlybehaves incorrectlybehaves incorrectlybehaves incorrectlyn/an/a
CCE 19.0.0behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 20.0.2behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.3behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.4behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
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
show
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: $AFAR/lib/llvm/bin/flang-24 -fc1 -triple amdgpu9.42-amd-amdhsa -emit-llvm-bc -fno-color-diagnostics -flto=full -mrelocation-model pic -pic-level 2 -target-cpu gfx942 -mlink-built
 #0 0x0000155543273e6a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) ($AFAR/lib/llvm/bin/../lib/libLLVM.so.24.0git+0x88ce6a)
 #1 0x0000155543270b46 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000155555116990 __restore_rt (/lib64/libpthread.so.0+0x12990)
 #3 0x000015554342e595 llvm::AllocaInst::getAllocationSize(llvm::DataLayout const&) const ($AFAR/lib/llvm/bin/../lib/libLLVM.so.24.0git+0xa47595)
 #4 0x0000155544337aa7 llvm::OpenMPIRBuilder::createTask(llvm::OpenMPIRBuilder::LocationDescription const&, llvm::IRBuilderBase::InsertPoint, llvm::ArrayRef<llvm::BasicBlock*>, llvm::function_ref<llvm
behaves incorrectlyAFAR 24.3.0, MI250X
show
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: $AFAR/lib/llvm/bin/flang-24 -fc1 -triple amdgpu9.0a-amd-amdhsa -emit-llvm-bc -fno-color-diagnostics -flto=full -mrelocation-model pic -pic-level 2 -target-cpu gfx90a -mlink-built
 #0 0x0000155543273e6a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) ($AFAR/lib/llvm/lib/libLLVM.so.24.0git+0x88ce6a)
 #1 0x0000155543270b46 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000155555116990 __restore_rt (/lib64/libpthread.so.0+0x12990)
 #3 0x000015554342e595 llvm::AllocaInst::getAllocationSize(llvm::DataLayout const&) const ($AFAR/lib/llvm/lib/libLLVM.so.24.0git+0xa47595)
 #4 0x0000155544337aa7 llvm::OpenMPIRBuilder::createTask(llvm::OpenMPIRBuilder::LocationDescription const&, llvm::IRBuilderBase::InsertPoint, llvm::ArrayRef<llvm::BasicBlock*>, llvm::function_ref<llvm
behaves incorrectlyAFAR 24.3.0, MI300X
show
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: $AFAR/lib/llvm/bin/flang-24 -fc1 -triple amdgpu9.42-amd-amdhsa -emit-llvm-bc -fno-color-diagnostics -flto=full -mrelocation-model pic -pic-level 2 -target-cpu gfx942 -mlink-built
 #0 0x00007f352428ce6a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) $AFAR/lib/llvm/lib/libLLVM.so.24.0git+0x88ce6a)
 #1 0x00007f3524289b46 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007f352323ebf0 __restore_rt (/lib64/libc.so.6+0x3ebf0)
 #3 0x00007f3524447595 llvm::AllocaInst::getAllocationSize(llvm::DataLayout const&) const $AFAR/lib/llvm/lib/libLLVM.so.24.0git+0xa47595)
 #4 0x00007f3525350aa7 llvm::OpenMPIRBuilder::createTask(llvm::OpenMPIRBuilder::LocationDescription const&, llvm::IRBuilderBase::InsertPoint, llvm::ArrayRef<llvm::BasicBlock*>, llvm::function_ref<llvm
behaves incorrectlyAFAR 24.3.0, MI350X
show
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: $AFAR/lib/llvm/bin/flang-24 -fc1 -triple amdgpu9.50-amd-amdhsa -emit-llvm-bc -fno-color-diagnostics -flto=full -mrelocation-model pic -pic-level 2 -target-cpu gfx950 -mlink-built
 #0 0x00007fda40c8ce6a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) $AFAR/lib/llvm/lib/libLLVM.so.24.0git+0x88ce6a)
 #1 0x00007fda40c89b46 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007fda3fc3fc30 __restore_rt (/lib64/libc.so.6+0x3fc30)
 #3 0x00007fda40e47595 llvm::AllocaInst::getAllocationSize(llvm::DataLayout const&) const $AFAR/lib/llvm/lib/libLLVM.so.24.0git+0xa47595)
 #4 0x00007fda41d50aa7 llvm::OpenMPIRBuilder::createTask(llvm::OpenMPIRBuilder::LocationDescription const&, llvm::IRBuilderBase::InsertPoint, llvm::ArrayRef<llvm::BasicBlock*>, llvm::function_ref<llvm
behaves incorrectlyCCE 19.0.0, MI300A unified
CCE 19.0.0, MI300A copy
CCE 19.0.0, MI250X
show
Warning:
 Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable..
MT_CONTEXT_TASKWAIT
   Error message      ::  unhandled construct type
   Error detected     ::  File '/workspace/crayftn/pdgcs/v_openmp.c', line 7617
   Initiated from     ::  Line 660 (v_main.c)
   Optimizer built    ::  2025-02-07 (production)
   File               ::  afar-cce19-task-in-target-ice.f90
behaves incorrectlyCCE 20.0.2, MI300A unified
CCE 20.0.2, MI300A copy
CCE 20.0.2, MI250X
show
Warning:
 Headers and libraries from cray-libsci/25.09.0 will be ignored because depends on PE_MPICH which is unavailable..
MT_CONTEXT_TASKWAIT
   Error message      ::  unhandled construct type
   Error detected     ::  File '/workspace/crayftn/pdgcs/v_openmp.c', line 7814
   Initiated from     ::  Line 660 (v_main.c)
   Optimizer built    ::  2025-11-17 (production)
   File               ::  afar-cce19-task-in-target-ice.f90
behaves incorrectlyCCE 21.0.3, MI300A unified
CCE 21.0.3, MI300A copy
CCE 21.0.3, MI250X
show
Warning:
 Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable..
MT_CONTEXT_TASKWAIT
   Error message      ::  unhandled construct type
   Error detected     ::  File '/workspace/crayftn/pdgcs/v_openmp.c', line 8197
   Initiated from     ::  Line 732 (v_main.c)
   Optimizer built    ::  2026-07-14 (production)
   File               ::  afar-cce19-task-in-target-ice.f90
behaves incorrectlyCCE 21.0.4, MI300A unified
CCE 21.0.4, MI300A copy
CCE 21.0.4, MI250X
show
Warning:
 Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable..
MT_CONTEXT_TASKWAIT
   Error message      ::  unhandled construct type
   Error detected     ::  File '/workspace/crayftn/pdgcs/v_openmp.c', line 8197
   Initiated from     ::  Line 732 (v_main.c)
   Optimizer built    ::  2026-09-24 (production)
   File               ::  afar-cce19-task-in-target-ice.f90
fails another wayNVHPC 25.11, A100 separate
NVHPC 25.11, A100 managed
show
NVFORTRAN-F-1196-OpenMP - omp task is not supported in GPU region (afar-cce19-task-in-target-ice.f90: 7)
NVFORTRAN/x86-64 Linux 25.11-0: compilation aborted
fails another wayNVHPC 26.9, A100 separate
NVHPC 26.9, A100 managed
show
NVFORTRAN-F-1196-OpenMP - omp task is not supported in GPU region (afar-cce19-task-in-target-ice.f90: 7)
NVFORTRAN/x86-64 Linux 26.9-0: compilation aborted

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

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 (14 lines)
program t
  implicit none
  integer :: c, r
  r = 0
  !$omp target map(from: r)
    c = 7
    !$omp task default(shared)
      c = 42
    !$omp end task
    !$omp taskwait
    r = c
  !$omp end target
  print *, 'r=', r
end program

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

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: $AFAR/lib/llvm/bin/flang-24 -fc1 -triple amdgpu9.42-amd-amdhsa -emit-llvm-bc -fno-color-diagnostics -flto=full -mrelocation-model pic -pic-level 2 -target-cpu gfx942 -mlink-built
 #0 0x0000155543273e6a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) ($AFAR/lib/llvm/bin/../lib/libLLVM.so.24.0git+0x88ce6a)
 #1 0x0000155543270b46 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000155555116990 __restore_rt (/lib64/libpthread.so.0+0x12990)
 #3 0x000015554342e595 llvm::AllocaInst::getAllocationSize(llvm::DataLayout const&) const ($AFAR/lib/llvm/bin/../lib/libLLVM.so.24.0git+0xa47595)
 #4 0x0000155544337aa7 llvm::OpenMPIRBuilder::createTask(llvm::OpenMPIRBuilder::LocationDescription const&, llvm::IRBuilderBase::InsertPoint, llvm::ArrayRef<llvm::BasicBlock*>, llvm::function_ref<llvm

What the specification requires

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

The same requirement as the issue cce19-target-parallel-single-ice.

OpenMP 5.2 §11.1 p.241 l.2-3

The single construct specifies that the associated structured block is executed by only one of the threads in the team

OpenMP 5.2 §11.1 p.241 l.5-6

An implicit barrier occurs at the end of a single region if the nowait clause is not specified.

Evidence

Same compiler, one change

  • the task and taskwait constructs removed (the task body kept): 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
    program t
      implicit none
      integer :: c, r
      r = 0
      !$omp target map(from: r)
        c = 7
          c = 42
        r = c
      !$omp end target
      print *, 'r=', r
    end program
    

Other compilers run it correctly

GCC 16.2.0