UNREACHABLE executed at /gpfs/work/pcp0/pcp0151/projects/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1355!

Hi,
Building my C++ application with the latest LLVM/Clang fails with the following error:

$ make
Scanning dependencies of target nestutil
[ 0%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/stopwatch.cpp.o
[ 1%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/numerics.cpp.o
[ 1%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/propagator_stability.cpp.o
[ 2%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/logging_event.cpp.o
[ 2%] Linking CXX shared library libnestutil.so
[ 2%] Built target nestutil
Scanning dependencies of target sli_lib
[ 2%] Building CXX object sli/CMakeFiles/sli_lib.dir/allocator.cpp.o
[ 3%] Building CXX object sli/CMakeFiles/sli_lib.dir/arraydatum.cc.o
no definition for emitted function
UNREACHABLE executed at /gpfs/work/pcp0/pcp0151/projects/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1355!
Stack dump:
0. Program arguments: /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8 -cc1 -triple nvptx64-nvidia-cuda -aux-triple powerpc64le-unknown-linux-gnu -S -disable-free -main-file-name arraydatum.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -no-integrated-as -fuse-init-array -mlink-cuda-bitcode /gpfs/software/opt/cuda/8.0.61/nvvm/libdevice/libdevice.compute_30.10.bc -target-feature +ptx42 -mlink-cuda-bitcode /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/lib/libomptarget-nvptx-sm_60.bc -target-cpu sm_60 -dwarf-column-info -debugger-tuning=gdb -resource-dir /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/lib/clang/8.0.0 -D sli_lib_EXPORTS -I /bgsys/drivers/ppcfloor/comm/gcc/include -I /gpfs/software/opt/gsl/2.4/include -I /gpfs/homeb/pcp0/pcp0151/projects/nest-simulator/libnestutil -I /gpfs/work/pcp0/pcp0151/build/nest-clang-upstream/libnestutil -I/gpfs/software/opt/gcc/5.4.0/include -I/gpfs/software/opt/cuda/8.0.61/extras/CUPTI/include -I/gpfs/software/opt/cuda/8.0.61/nvvm/include -I/gpfs/software/opt/cuda/8.0.61/include -I/gpfs/software/opt/cubegui/4.4-TP3/include -I/gpfs/software/opt/cubelib/4.4-TP3/include -I/gpfs/software/opt/scalasca/2.3.1-gnu5.4-ompi2.0.0/include -I/gpfs/software/opt/gsl/2.4/include -internal-isystem /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/…/…/…/…/include/c++/4.8.5 -internal-isystem /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/…/…/…/…/include/c++/4.8.5/ppc64le-redhat-linux -internal-isystem /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/…/…/…/…/include/c++/4.8.5/backward -internal-isystem /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/…/…/…/…/include/c++/4.8.5 -internal-isystem /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/…/…/…/…/include/c++/4.8.5/ppc64le-redhat-linux -internal-isystem /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/…/…/…/…/include/c++/4.8.5/backward -internal-isystem /usr/local/include -internal-isystem /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/lib/clang/8.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/local/include -internal-isystem /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/lib/clang/8.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wall -std=c++11 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /gpfs/work/pcp0/pcp0151/build/nest-clang-upstream/sli -ferror-limit 19 -fmessage-length 95 -fopenmp -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/arraydatum-5dbb9f.s -x c++ /gpfs/homeb/pcp0/pcp0151/projects/nest-simulator/sli/arraydatum.cc -fopenmp-is-device -fopenmp-host-ir-file-path /tmp/arraydatum-820a98.bc

  1. parser at end of file
  2. Per-file LLVM IR generation
  3. /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/…/…/…/…/include/c++/4.8.5/ppc64le-redhat-linux/bits/gthr-default.h:236:1 <Spelling=:14:1>: Generating code for declaration ‘__gthrw___pthread_key_create’
    #0 0x0000000012161e24 PrintStackTraceSignalHandler(void*) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12161e24)
    #1 0x000000001215f068 llvm::sys::RunSignalHandlers() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x1215f068)
    #2 0x0000000012162108 SignalHandler(int) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12162108)
    #3 0x00003fff996f0478 0x478 __GI_abort
    #4 0x00003fff996f0478
    #5 0x00003fff996f0478 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (+0x478)
    #6 0x00003fff990d1494 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/lib64/libc.so.6+0x41494)
    #7 0x00000000120f9f24 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x120f9f24)
    #8 0x0000000012445368 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12445368)
    #9 0x0000000012466c2c clang::CodeGen::CodeGenModule::EmitDeferred() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12466c2c)
    #10 0x000000001245d6c4 clang::CodeGen::CodeGenModule::EmitDeferred() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x1245d6c4)
    #11 0x0000000012451ed8 clang::CodeGen::CodeGenModule::EmitDeferred() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451ed8)
    #12 0x0000000012451f04 clang::CodeGen::CodeGenModule::EmitDeferred() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451f04)
    #13 0x0000000012451f04 clang::CodeGen::CodeGenModule::EmitDeferred() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451f04)
    #14 0x0000000012451f04 clang::CodeGen::CodeGenModule::EmitDeferred() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451f04)
    #15 0x0000000012451f04 clang::CodeGen::CodeGenModule::EmitDeferred() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451f04)
    #16 0x0000000012451f04 clang::CodeGen::CodeGenModule::Release() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451f04)
    #17 0x0000000012451f04 (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451f04)
    #18 0x0000000012451284 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12451284)
    #19 0x0000000012cd5914 clang::ParseAST(clang::Sema&, bool, bool) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12cd5914)
    #20 0x0000000012cd168c clang::ASTFrontendAction::ExecuteAction() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12cd168c)
    #21 0x0000000013637784 clang::CodeGenAction::ExecuteAction() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x13637784)
    #22 0x00000000128cdebc clang::FrontendAction::Execute() (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x128cdebc)
    #23 0x0000000012cd025c clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x12cd025c)
    #24 0x00000000128cd540 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x128cd540)
    #25 0x00000000128806f4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x128806f4)
    #26 0x00000000129943b8 main (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x129943b8)
    #27 0x000000001054e5d4 generic_start_main.isra.0 (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x1054e5d4)
    #28 0x000000001054ae90 __libc_start_main (/gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8+0x1054ae90)
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8[0x12161e24]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN4llvm3sys17RunSignalHandlersEv+0xc8)[0x1215f068]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8[0x12162108]
    [0x3fff996f0478]
    /lib64/libc.so.6(abort+0x2b4)[0x3fff990d1494]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN4llvm25llvm_unreachable_internalEPKcS1_j+0x2c4)[0x120f9f24]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen15CodeGenFunction12GenerateCodeENS_10GlobalDeclEPN4llvm8FunctionERKNS0_14CGFunctionInfoE+0x9d8)[0x12445368]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE+0x20c)[0x12466c2c]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE+0xe4)[0x1245d6c4]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv+0x148)[0x12451ed8]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv+0x174)[0x12451f04]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv+0x174)[0x12451f04]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv+0x174)[0x12451f04]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv+0x174)[0x12451f04]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv+0x174)[0x12451f04]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv+0x174)[0x12451f04]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang7CodeGen13CodeGenModule7ReleaseEv+0x34)[0x12451284]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8[0x12cd5914]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8[0x12cd168c]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang8ParseASTERNS_4SemaEbb+0x304)[0x13637784]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang17ASTFrontendAction13ExecuteActionEv+0xdc)[0x128cdebc]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang13CodeGenAction13ExecuteActionEv+0x34c)[0x12cd025c]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang14FrontendAction7ExecuteEv+0xf0)[0x128cd540]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x504)[0x128806f4]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x7f8)[0x129943b8]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x744)[0x1054e5d4]
    /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin/clang-8(main+0x2fd0)[0x1054ae90]
    /lib64/libc.so.6(+0x24980)[0x3fff990b4980]
    /lib64/libc.so.6(__libc_start_main+0xc4)[0x3fff990b4b74]
    clang-8: error: unable to execute command: Aborted (core dumped)
    clang-8: error: clang frontend command failed due to signal (use -v to see invocation)
    clang version 8.0.0 (https://github.com/llvm-mirror/clang b14b766b1c2e712e1b2ccca1418fb0fbb68d0230) (https://github.com/llvm-mirror/llvm 709fda69699e80166483f87a0273bb3bd04bba69)
    Target: powerpc64le-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /gpfs/work/pcp0/pcp0151/opt/llvm+clang-upstream/bin
    clang-8: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
    clang-8: note: diagnostic msg: Error generating preprocessed source(s).
    make[2]: *** [sli/CMakeFiles/sli_lib.dir/arraydatum.cc.o] Error 254
    make[1]: *** [sli/CMakeFiles/sli_lib.dir/all] Error 2
    make: *** [all] Error 2

Could this be a LLVM/Clang bug?

Itaru.