Issue 52938
Summary [OpenMP] compiler crash due to -Rpass=openmp-opt
Labels new issue
Assignees jdoerfert
Reporter ye-luo
    reproducer code https://github.com/ye-luo/openmp-target/blob/master/tests/target_task/target_nowait_task.cpp
```
$ clang++ -fopenmp -Rpass=openmp-opt -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target=nvptx64-nvidia-cuda -march=sm_61 target_nowait_task.cpp
clang-14: /home/yeluo/opt/llvm-clang/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:4646: llvm::DILocalVariable* clang::CodeGen::CGDebugInfo::EmitDeclareOfAutoVariable(const clang::VarDecl*, llvm::Value*, clang::CodeGen::CGBuilderTy&, bool): Assertion `CGM.getCodeGenOpts().hasReducedDebugInfo()' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /soft/llvm/main-20211229/bin/clang-14 -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -clear-ast-before-backend -main-file-name target_nowait_task.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/yeluo/opt/openmp-target/tests/target_task -resource-dir /soft/llvm/main-20211229/lib/clang/14.0.0 -c-isystem /home/packages/spack/opt/spack/linux-ubuntu20.04-zen/gcc-10.2.0/openblas-0.3.12-tredfknoqd2f5ohb65jwg2u2m6vwmylf/include -c-isystem /home/packages/spack/opt/spack/linux-ubuntu20.04-zen/gcc-10.2.0/fftw-3.3.8-vnmhmagaslns7oiffddnkwz7oeoaj5vh/include -cxx-isystem /home/packages/spack/opt/spack/linux-ubuntu20.04-zen/gcc-10.2.0/openblas-0.3.12-tredfknoqd2f5ohb65jwg2u2m6vwmylf/include -cxx-isystem /home/packages/spack/opt/spack/linux-ubuntu20.04-zen/gcc-10.2.0/fftw-3.3.8-vnmhmagaslns7oiffddnkwz7oeoaj5vh/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /soft/llvm/main-20211229/lib/clang/14.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /soft/llvm/main-20211229/lib/clang/14.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/local/cuda-11.0/include -Rpass=openmp-opt -fdeprecated-macro -fdebug-compilation-dir=/home/yeluo/opt/openmp-target/tests/target_task -ferror-limit 19 -fopenmp -fopenmp-target-new-runtime -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -disable-llvm-passes -fopenmp-targets=nvptx64-nvidia-cuda -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/target_nowait_task-ad38c8.bc -x c++ target_nowait_task.cpp
1.	<eof> parser at end of file
2.	Per-file LLVM IR generation
3.	target_nowait_task.cpp:4:5: Generating code for declaration 'main'
 #0 0x00005652d4b093c4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005652d4b06b1e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f72860793c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007f7285b1818b raise /build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007f7285af7859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007f7285af7729 get_sysdep_segment_value /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007f7285af7729 _nl_load_domain /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007f7285b08f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x00005652d4ed5dca (/soft/llvm/main-20211229/bin/clang-14+0x2e18dca)
 #9 0x00005652d4f6243f clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective const&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, llvm::Function*, clang::CodeGen::OMPTaskDataTy const&)> const&, clang::CodeGen::OMPTaskDataTy&)::'lambda'(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&)::operator()(clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) const CGStmtOpenMP.cpp:0:0
#10 0x00005652d533431e clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&) const (/soft/llvm/main-20211229/bin/clang-14+0x327731e)
#11 0x00005652d53346ac (anonymous namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&, clang::Stmt const*) CGOpenMPRuntime.cpp:0:0
#12 0x00005652d4f16073 clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(clang::CapturedStmt const&) (/soft/llvm/main-20211229/bin/clang-14+0x2e59073)
#13 0x00005652d536f543 clang::CodeGen::CGOpenMPRuntime::emitTaskOutlinedFunction(clang::OMPExecutableDirective const&, clang::VarDecl const*, clang::VarDecl const*, clang::VarDecl const*, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, bool, unsigned int&) (/soft/llvm/main-20211229/bin/clang-14+0x32b2543)
#14 0x00005652d4f5ec0e clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective const&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, llvm::Function*, clang::CodeGen::OMPTaskDataTy const&)> const&, clang::CodeGen::OMPTaskDataTy&) (/soft/llvm/main-20211229/bin/clang-14+0x2ea1c0e)
#15 0x00005652d4f5ffb6 clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective const&) (/soft/llvm/main-20211229/bin/clang-14+0x2ea2fb6)
#16 0x00005652d4f16a97 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/soft/llvm/main-20211229/bin/clang-14+0x2e59a97)
#17 0x00005652d4f1cb64 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/soft/llvm/main-20211229/bin/clang-14+0x2e5fb64)
#18 0x00005652d4f78503 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/soft/llvm/main-20211229/bin/clang-14+0x2ebb503)
#19 0x00005652d4f8a49c clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/soft/llvm/main-20211229/bin/clang-14+0x2ecd49c)
#20 0x00005652d4fe66d6 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/soft/llvm/main-20211229/bin/clang-14+0x2f296d6)
#21 0x00005652d4fe21b5 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/soft/llvm/main-20211229/bin/clang-14+0x2f251b5)
#22 0x00005652d4fee161 clang::CodeGen::CodeGenModule::EmitDeferred() (/soft/llvm/main-20211229/bin/clang-14+0x2f31161)
#23 0x00005652d4ff050c clang::CodeGen::CodeGenModule::Release() (/soft/llvm/main-20211229/bin/clang-14+0x2f3350c)
#24 0x00005652d5d09fda (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ModuleBuilder.cpp:0:0
#25 0x00005652d5d08835 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/soft/llvm/main-20211229/bin/clang-14+0x3c4b835)
#26 0x00005652d6a7a1d9 clang::ParseAST(clang::Sema&, bool, bool) (/soft/llvm/main-20211229/bin/clang-14+0x49bd1d9)
#27 0x00005652d5d07668 clang::CodeGenAction::ExecuteAction() (/soft/llvm/main-20211229/bin/clang-14+0x3c4a668)
#28 0x00005652d55dee49 clang::FrontendAction::Execute() (/soft/llvm/main-20211229/bin/clang-14+0x3521e49)
#29 0x00005652d556c43e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/soft/llvm/main-20211229/bin/clang-14+0x34af43e)
#30 0x00005652d56bff93 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/soft/llvm/main-20211229/bin/clang-14+0x3602f93)
#31 0x00005652d2ffba15 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/soft/llvm/main-20211229/bin/clang-14+0xf3ea15)
#32 0x00005652d2ff8008 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#33 0x00005652d2f74e51 main (/soft/llvm/main-20211229/bin/clang-14+0xeb7e51)
#34 0x00007f7285af90b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#35 0x00005652d2ff7b7e _start (/soft/llvm/main-20211229/bin/clang-14+0xf3ab7e)
clang-14: error: unable to execute command: Aborted (core dumped)
clang-14: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git 298367ee6e36eeb1b193ad9fa92082c2ef2345a3)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /soft/llvm/master-latest/bin
clang-14: note: diagnostic msg: Error generating preprocessed source(s).
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to