OffTarget

Observed issues › fuzz/s1-6085-cce21

Appears to behave incorrectlyCompiler crash · Fortran · OpenMP · Open

craycc/ftn: OpenMP 5.1/5.2/6.0 forms HPE does not claim are rejected, and some crash the compiler instead of a diagnostic

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

Same issue as catalog/cce-c-map-iterator-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.0correctcorrectunknown
not run
correctcorrectn/an/a
CCE 19.0.0fails another wayfails another wayunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 20.0.2behaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.3behaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.4behaves incorrectlybehaves incorrectlyunknown
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.0fails another wayfails another wayfails another wayfails another wayfails another wayfails another wayn/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 incorrectlyCCE 20.0.2, MI300A unified
CCE 20.0.2, MI300A copy
show
Warning:
 Headers and libraries from cray-libsci/25.09.0 will be ignored because depends on PE_MPICH which is unavailable..
Global is external, but doesn't have external or weak linkage!
ptr @"default$mapper$rec_t$fuzz_prog__"
LLVM ERROR: Broken module found, compilation aborted!
 #0 0x000000000154f4c7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/20.0.2/cce/x86_64/bin/optcg+0x154f4c7)
 #1 0x000000000154c7f3 SignalHandler(int) (/opt/cray/pe/cce/20.0.2/cce/x86_64/bin/optcg+0x154c7f3)
 #2 0x000015555511698f (/lib64/libpthread.so.0+0x1298f)
behaves incorrectlyCCE 21.0.3, MI300A unified
CCE 21.0.3, MI300A copy
show
Warning:
 Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable..
Global is external, but doesn't have external or weak linkage!
ptr @"default$mapper$rec_t$fuzz_prog__"
LLVM ERROR: Broken module found, compilation aborted!
 #0 0x0000000001577407 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/21.0.3/cce/x86_64/bin/optcg+0x1577407)
 #1 0x00000000015742b4 SignalHandler(int, siginfo_t*, void*) (/opt/cray/pe/cce/21.0.3/cce/x86_64/bin/optcg+0x15742b4)
 #2 0x000015555511698f (/lib64/libpthread.so.0+0x1298f)
behaves incorrectlyCCE 21.0.4, MI300A unified
CCE 21.0.4, MI300A copy
show
Warning:
 Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable..
Global is external, but doesn't have external or weak linkage!
ptr @"default$mapper$rec_t$fuzz_prog__"
LLVM ERROR: Broken module found, compilation aborted!
 #0 0x00000000015773d7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/21.0.4/cce/x86_64/bin/optcg+0x15773d7)
 #1 0x0000000001574284 SignalHandler(int, siginfo_t*, void*) (/opt/cray/pe/cce/21.0.4/cce/x86_64/bin/optcg+0x1574284)
 #2 0x000015555511698f (/lib64/libpthread.so.0+0x1298f)
fails another wayCCE 19.0.0, MI300A unified
CCE 19.0.0, MI300A copy
show
Warning:
 Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable..
  module integer function gs1(x)
                          ^      
ftn-287 ftn: WARNING GS1, File = s1-6085-cce21.f90, Line = 22, Column = 27 
  The result of function name "GS1" in the function subprogram is not defined.
  end function gs1
ftn-7212 ftn: WARNING GS1, File = s1-6085-cce21.f90, Line = 24 
fails another wayNVHPC 25.11, A100 separate
NVHPC 25.11, A100 managed
NVHPC 26.9, A100 separate
NVHPC 26.9, A100 managed
show
NVFORTRAN-W-0155-Unimplemented feature - DECLARE REDUCTION  (s1-6085-cce21.f90: 8)
  0 inform,   1 warnings,   0 severes, 0 fatal for fuzz_dmod
NVFORTRAN-S-0155-The reduction intrinsic must be MAX, MIN, IAND, IOR, or IEOR, not padd (s1-6085-cce21.f90: 48)
  0 inform,   0 warnings,   1 severes, 0 fatal for kp2
fails another wayGCC 16.2.0, MI300A unified
GCC 16.2.0, MI300A copy
GCC 16.2.0, MI250X
GCC 16.2.0, MI300X
GCC 16.2.0, MI350X
GCC 16.2.0, A100 separate
show
s1-6085-cce21.f90:48:38:
   48 |     !$omp target teams loop reduction(padd: rp2a)
      |                                      1
Error: !$OMP DECLARE REDUCTION padd not found at (1)

Reproduce

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

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 (91 lines)
! Finding: CCE 20 and 21 internal compiler error: optcg killed by
! signal 6 (ftn-2116 "optcg was terminated due to receipt of signal 06:
! Aborted") on a program with a target teams loop that maps a pointer
! component (map(always, tofrom: dr%pc)) and reduces with a user-defined
! reduction (reduction(padd: rp2a), declare reduction padd for a derived
! type), next to a target teams region with map(tofrom: dr) and
! reduction(min: r1a). CCE 19 does not implement user-defined reductions
! in target regions (not_implemented, a support gap).
!
! Legal OpenMP 5.2 (declare reduction §5.5.11 and its use on teams/loop,
! §5.5.8; a pointer component in a map clause, §5.8.3). Legality: 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.
!
! Observed (tuolumne, MI300A, -O2, 2026-10-23, results/t28_probe/icev2.log):
! the confirmer's reduction of s1 seed 6085 (results/confirm/drafts/
! fuzz_s1_6085_cce21_gfx942_unified, 216 -> 179 lines, ICE kept) gives the
! optcg abort on CCE 20 and 21; this file is that program reduced further
! on CCE 21 by deleting lines while the abort stays
! (data/evidence/dataenv_probe/min_ice.py; 179 -> 130 lines). Hand-written forms of
! the two kernels alone do not reproduce it (data/evidence/dataenv_probe/ice/b1-b3.f90:
! CCE reports "Unsupported OpenMP construct Calls -- __GET_DYNAMIC_TYPE" or
! compiles). Fuzz campaign s1: the ftn-2116 signal 06 cells of CCE 19/20/21.
!
! Fix: reduced further by clause and list-item
! deletion as well as lines (data/evidence/dataenv_probe/min_ice.py, 130 -> 56 lines,
! results/t28_probe/short/): two empty target teams constructs, one with
! map(tofrom: dr) (a structure with an allocatable component) and
! reduction(min: r1a), one a target teams loop with the user reduction
! reduction(padd: rp2a), and a module procedure in a submodule; the optcg
! abort stays on CCE 20 and 21, CCE 19 reports user reductions not
! implemented, AFAR compiles it (results/t28_probe/icev_fr1.log).
!
! ftn -fopenmp -O2 (a bundle: 
!@file fuzz_dmod.f90
module fuzz_dmod
  implicit none
  type :: mt_t
  end type mt_t
  type :: pair_t
    integer :: x, y
  end type pair_t
  !$omp declare reduction(padd: pair_t: omp_out = pair_t(omp_out%x + omp_in%x, omp_out%y + omp_in%y)) &
  !$omp& initializer(omp_priv = pair_t(0, 0))
end module fuzz_dmod
!@file fuzz_smod.f90
module fuzz_smod
  implicit none
  interface
    module integer function gs1(x)
      integer, intent(in) :: x
    end function gs1
  end interface
end module fuzz_smod
!@file fuzz_ssub.f90
submodule (fuzz_smod) fuzz_ssub
  implicit none
contains
  module integer function gs1(x)
    integer, intent(in) :: x
  end function gs1
end submodule fuzz_ssub
!@file fuzz_prog.f90
program fuzz_prog
  use fuzz_dmod
  implicit none
  integer, parameter :: n = 100, m = 5
  type :: rec_t
    integer, allocatable :: o1(:)
  end type rec_t
  type(pair_t) :: rp2a
  integer :: i, r1a
contains
  subroutine kp1(xr4, dr)
    real(4), allocatable, intent(in) :: xr4(:)
    type(rec_t), intent(inout) :: dr
    !$omp target teams map(tofrom: dr) reduction(min: r1a)
    !$omp end target teams
  end subroutine kp1
  subroutine kp2(ic, xk1, xr4, dr, ms)
    integer, intent(inout) :: ic(:, :)
    integer(1), allocatable, intent(in) :: xk1(:)
    real(4), intent(in) :: xr4(:)
    type(rec_t), intent(inout) :: dr
    type(mt_t), intent(inout) :: ms
    !$omp target teams loop reduction(padd: rp2a)
    do i = 1, n
    end do
  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

Warning:
 Headers and libraries from cray-libsci/25.09.0 will be ignored because depends on PE_MPICH which is unavailable..
Global is external, but doesn't have external or weak linkage!
ptr @"default$mapper$rec_t$fuzz_prog__"
LLVM ERROR: Broken module found, compilation aborted!
 #0 0x000000000154f4c7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/20.0.2/cce/x86_64/bin/optcg+0x154f4c7)
 #1 0x000000000154c7f3 SignalHandler(int) (/opt/cray/pe/cce/20.0.2/cce/x86_64/bin/optcg+0x154c7f3)
 #2 0x000015555511698f (/lib64/libpthread.so.0+0x1298f)

What the specification requires

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

OpenMP 5.2 §5.5.11

OpenMP 5.2 §5.5.8

OpenMP 5.2 §5.8.3

Evidence

Same compiler, one change

  • reduction(min: r1a) removed from the first target teams: AFAR 24.3.0: fails another way; CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
    Control program
    module fuzz_dmod
      implicit none
      type :: mt_t
      end type mt_t
      type :: pair_t
        integer :: x, y
      end type pair_t
      !$omp declare reduction(padd: pair_t: omp_out = pair_t(omp_out%x + omp_in%x, omp_out%y + omp_in%y)) &
      !$omp& initializer(omp_priv = pair_t(0, 0))
    end module fuzz_dmod
    module fuzz_smod
      implicit none
      interface
        module integer function gs1(x)
          integer, intent(in) :: x
        end function gs1
      end interface
    end module fuzz_smod
    submodule (fuzz_smod) fuzz_ssub
      implicit none
    contains
      module integer function gs1(x)
        integer, intent(in) :: x
      end function gs1
    end submodule fuzz_ssub
    program fuzz_prog
      use fuzz_dmod
      implicit none
      integer, parameter :: n = 100, m = 5
      type :: rec_t
        integer, allocatable :: o1(:)
      end type rec_t
      type(pair_t) :: rp2a
      integer :: i, r1a
    contains
      subroutine kp1(xr4, dr)
        real(4), allocatable, intent(in) :: xr4(:)
        type(rec_t), intent(inout) :: dr
        !$omp target teams map(tofrom: dr)
        !$omp end target teams
      end subroutine kp1
      subroutine kp2(ic, xk1, xr4, dr, ms)
        integer, intent(inout) :: ic(:, :)
        integer(1), allocatable, intent(in) :: xk1(:)
        real(4), intent(in) :: xr4(:)
        type(rec_t), intent(inout) :: dr
        type(mt_t), intent(inout) :: ms
        !$omp target teams loop reduction(padd: rp2a)
        do i = 1, n
        end do
      end subroutine kp2
    end program fuzz_prog
    

Other compilers run it correctly

AFAR 24.3.0