OffTarget

Observed issues › catalog/cce-c-long-double-ice

Appears to behave incorrectlyCompiler crash · C · OpenMP · Open

craycc: internal compiler error on long double arithmetic in a target loop

Legality: not independently confirmed. Independent readings are uncertain: Both readings agree. The only mapping restriction is a mappable type, and the specification does not exclude long double or require a device to support it. The program is race-free. Whether a compiler must accept long double in a target region is not stated, and no compiler is recorded as passing, so requiring acceptance is not supported. How this is checked

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.0fails another wayfails another wayfails another wayfails another wayfails another wayn/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.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 19.0.0, MI300A unified
CCE 19.0.0, MI300A copy
show
llc: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1723: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc -mtriple=amdgcn-amd-amdhsa -disable-promote-alloca-to-lds -mcpu=gfx942 <dir>/cooltmpdir-yyv734/repro-cce-openmp-pre-llc.bc -filet
1.	Running pass 'CallGraph Pass Manager' on module '<dir>/cooltmpdir-yyv734/repro-cce-openmp-pre-llc.bc'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_1c6fb038_main_l17'
 #0 0x0000000003f00137 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc+0x3f00137)
 #1 0x0000000003efd02b SignalHandler(int) (/opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc+0x3efd02b)
behaves incorrectlyCCE 19.0.0, MI250X
show
llc: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1723: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc -mtriple=amdgcn-amd-amdhsa -disable-promote-alloca-to-lds -mcpu=gfx90a <dir>/cooltmpdir-WqC60z/repro-cce-openmp-pre-llc.bc -filet
1.	Running pass 'CallGraph Pass Manager' on module '<dir>/cooltmpdir-WqC60z/repro-cce-openmp-pre-llc.bc'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_378b091e_main_l17'
 #0 0x0000000003f00137 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc+0x3f00137)
 #1 0x0000000003efd02b SignalHandler(int) (/opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc+0x3efd02b)
behaves incorrectlyCCE 20.0.2, MI300A unified
CCE 20.0.2, MI300A copy
show
lld: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1767: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/20.0.2/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -plugin-opt=mcpu=gfx942 -plugin-opt=-disable-promote-alloca-to-lds -plugin-opt=defaults=cray -
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_1c69ba31_main_l17'
 #0 0x0000000000a4ac57 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/20.0.2/cce-clang/x86_64/bin/lld+0xa4ac57)
 #1 0x0000000000a47f83 SignalHandler(int) (/opt/cray/pe/cce/20.0.2/cce-clang/x86_64/bin/lld+0xa47f83)
behaves incorrectlyCCE 20.0.2, MI250X
show
lld: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1767: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/20.0.2/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -plugin-opt=mcpu=gfx90a -plugin-opt=-disable-promote-alloca-to-lds -plugin-opt=defaults=cray -
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_378c5515_main_l17'
 #0 0x0000000000a4ac57 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/20.0.2/cce-clang/x86_64/bin/lld+0xa4ac57)
 #1 0x0000000000a47f83 SignalHandler(int) (/opt/cray/pe/cce/20.0.2/cce-clang/x86_64/bin/lld+0xa47f83)
behaves incorrectlyCCE 21.0.3, MI300A unified
CCE 21.0.3, MI300A copy
show
lld: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1762: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/21.0.3/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -plugin-opt=mcpu=gfx942 -plugin-opt=-disable-promote-alloca-to-lds -plugin-opt=defaults=cray -
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_1c6d393b_main_l17'
 #0 0x0000000000a04627 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/21.0.3/cce-clang/x86_64/bin/lld+0xa04627)
 #1 0x0000000000a01264 SignalHandler(int, siginfo_t*, void*) (/opt/cray/pe/cce/21.0.3/cce-clang/x86_64/bin/lld+0xa01264)
behaves incorrectlyCCE 21.0.3, MI250X
show
lld: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1762: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/21.0.3/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -plugin-opt=mcpu=gfx90a -plugin-opt=-disable-promote-alloca-to-lds -plugin-opt=defaults=cray -
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_3792fa14_main_l17'
 #0 0x0000000000a04627 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/21.0.3/cce-clang/x86_64/bin/lld+0xa04627)
 #1 0x0000000000a01264 SignalHandler(int, siginfo_t*, void*) (/opt/cray/pe/cce/21.0.3/cce-clang/x86_64/bin/lld+0xa01264)
behaves incorrectlyCCE 21.0.4, MI300A unified
CCE 21.0.4, MI300A copy
show
lld: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1762: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/21.0.4/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -plugin-opt=mcpu=gfx942 -plugin-opt=-disable-promote-alloca-to-lds -plugin-opt=defaults=cray -
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_1c7a6a63_main_l17'
 #0 0x0000000000a04627 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/21.0.4/cce-clang/x86_64/bin/lld+0xa04627)
 #1 0x0000000000a01264 SignalHandler(int, siginfo_t*, void*) (/opt/cray/pe/cce/21.0.4/cce-clang/x86_64/bin/lld+0xa01264)
behaves incorrectlyCCE 21.0.4, MI250X
show
lld: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1762: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/21.0.4/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -plugin-opt=mcpu=gfx90a -plugin-opt=-disable-promote-alloca-to-lds -plugin-opt=defaults=cray -
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_379214ce_main_l17'
 #0 0x0000000000a04627 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/21.0.4/cce-clang/x86_64/bin/lld+0xa04627)
 #1 0x0000000000a01264 SignalHandler(int, siginfo_t*, void*) (/opt/cray/pe/cce/21.0.4/cce-clang/x86_64/bin/lld+0xa01264)
fails another wayAFAR 24.3.0, MI300A unified
AFAR 24.3.0, MI300A copy
AFAR 24.3.0, MI250X
AFAR 24.3.0, MI300X
AFAR 24.3.0, MI350X
show
ld.lld: error: no libcall available for sint_to_fp
ld.lld: error: no libcall available for fadd
ld.lld: error: no libcall available for fadd
clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
$AFAR/lib/llvm/bin/clang-linker-wrapper: error: 'clang' failed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
fails another wayNVHPC 25.11, A100 separate
NVHPC 25.11, A100 managed
show
Accelerator Fatal Error: Failed to find device function 'nvkernel_main_F1L16_2'! File was compiled with: -gpu=cc80
Rebuild this file with -gpu=cc80 to use NVIDIA Tesla GPU 0
 File: <dir>/cce-c-long-double-ice.c
 Function: main:7
 Line: 16
fails another wayNVHPC 26.9, A100 separate
NVHPC 26.9, A100 managed
show
Accelerator Fatal Error: Failed to find device function 'nvkernel_main_F1L19_2'! File was compiled with: -gpu=cc80
Rebuild this file with -gpu=cc80 to use NVIDIA Tesla GPU 0
 File: <dir>/cce-c-long-double-ice.c
 Function: main:7
 Line: 19
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
RESULT ran_on_host=0 check=fail

Reproduce

CCE 19.0.0, MI300A unified

module load cce/19.0.0 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
craycc -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx942 -fopenmp-version=52 -O2 repro.c -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
craycc -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx942 -fopenmp-version=52 -O2 repro.c -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
craycc -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx942 -fopenmp-version=52 -O2 repro.c -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
craycc -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx942 -fopenmp-version=52 -O2 repro.c -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (57 lines)
// # Draft finding: omp52-c-w-long-double on cce19
//
// - compiler: cce19
// - toolchain: cce19; arch: gfx942; machine: tuolumne; memory mode: unified; opt: -O2
// - program: catalog omp52-c-w-long-double (c, version 52, sha256 95c075422c35bf6b)
// - expected: None (None; )
// - actual: ice  (ice: PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.)
// - verdict: compiler_bug by rule R10-compile-ice: an internal compiler error (or the compiler rejecting code it generated) on a legal program: always the compiler's defect
// - reason: 
// - citations: RUL-COMPILE-TIME (rulings.md)
// - legality: legal: offload.engine.prerun.check accepts it (rerun: offload.engine.rules with the
//   race rule and the restriction checks, and the AFAR clang front end, not under test here); no
//   compiler under test, gfortran or gcc is a legality witness
// - witnesses: none
// - withdrawn: none
//
// Generated by compliance.widen (OpenMP 5.2, C11; catalog widening). Do not edit.
// id: omp52-c-w-long-double
// primary atom: base.device.long_double
// atoms: base.device.long_double
// legal: yes
// observable: yes
// ran_on_host: inside the target region of interest
// evidence: construct
// needs: none
// std: c11
// feature: long double arithmetic on a mapped long double array (the representation of long double is implementation defined; a device that has no wider type than double may reject it)
// spec: OpenMP 5.2 §1.7, p.35: C11 is a normative base language
#include <stdio.h>
#include <stdbool.h>
#include <omp.h>

enum { n = 64 };

int main(void) {
  int a[n], b[n], ref[n];
  int host_flag = 1;
  long double ld[n];
  for (int i = 0; i < n; i++) {
    a[i] = i + 1;
    b[i] = 0;
    ref[i] = 2 * (i + 1) + 1;
  }
  for (int i = 0; i < n; i++) ld[i] = 0.0L;
  #pragma omp target teams distribute parallel for map(to: a) map(from: ld) map(tofrom: \
      host_flag)
  for (int i = 0; i < n; i++) {
    ld[i] = (long double)a[i] * 2.0L + 1.0L;
    if (i == 0) host_flag = omp_is_initial_device();
  }
  for (int i = 0; i < n; i++) b[i] = (int)ld[i];
  bool ok = true;
  for (int i = 0; i < n; i++)
    ok = ok && (b[i] == ref[i]);
  printf("RESULT ran_on_host=%d check=%s\n", host_flag, ok ? "pass" : "fail");
  return 0;
}

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

llc: /workspace/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1723: llvm::SDValue llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&, llvm::EVT, bool, bool): Assertion `Elt-
PLEASE submit a bug report to HPE at https://support.hpe.com/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc -mtriple=amdgcn-amd-amdhsa -disable-promote-alloca-to-lds -mcpu=gfx942 <dir>/cooltmpdir-yyv734/repro-cce-openmp-pre-llc.bc -filet
1.	Running pass 'CallGraph Pass Manager' on module '<dir>/cooltmpdir-yyv734/repro-cce-openmp-pre-llc.bc'.
2.	Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@__omp_offloading_14_1c6fb038_main_l17'
 #0 0x0000000003f00137 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc+0x3f00137)
 #1 0x0000000003efd02b SignalHandler(int) (/opt/cray/pe/cce/19.0.0/cce-clang/x86_64/bin/llc+0x3efd02b)

What the specification requires

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

OpenMP 5.2 §1.7 p.35

Evidence

Same compiler, one change

  • double instead of long double: 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
    #include <stdio.h>
    #include <stdbool.h>
    #include <omp.h>
    
    enum { n = 64 };
    
    int main(void) {
      int a[n], b[n], ref[n];
      int host_flag = 1;
      double ld[n];
      for (int i = 0; i < n; i++) {
        a[i] = i + 1;
        b[i] = 0;
        ref[i] = 2 * (i + 1) + 1;
      }
      for (int i = 0; i < n; i++) ld[i] = 0.0;
      #pragma omp target teams distribute parallel for map(to: a) map(from: ld) map(tofrom: \
          host_flag)
      for (int i = 0; i < n; i++) {
        ld[i] = (double)a[i] * 2.0 + 1.0;
        if (i == 0) host_flag = omp_is_initial_device();
      }
      for (int i = 0; i < n; i++) b[i] = (int)ld[i];
      bool ok = true;
      for (int i = 0; i < n; i++)
        ok = ok && (b[i] == ref[i]);
      printf("RESULT ran_on_host=%d check=%s\n", host_flag, ok ? "pass" : "fail");
      return 0;
    }