[llvm-bugs] [Bug 45911] New: Data sharing and lambda capture: No context value for inlined OpenMP region

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 13 10:45:36 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45911

            Bug ID: 45911
           Summary: Data sharing and lambda capture: No context value for
                    inlined OpenMP region
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: schuchart at hlrs.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 23484
  --> https://bugs.llvm.org/attachment.cgi?id=23484&action=edit
Reproducer cpp file

I came across the following error when I accidentally left a variable undefined
inside a lambda, which was defined outside the lambda. The source file is
attached to this issue. 

No context value for inlined OpenMP region
UNREACHABLE executed at llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:247!
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: clang++ -c -fopenmp -fopenmp-version=50
test_omp_lambda.cc -o test_omp_lambda 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      test_omp_lambda.cc:22:7: Generating code for declaration
'main()::(anonymous class)::operator()'
 #0 0x0000000002b4e21a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(clang-11+0x2b4e21a)
 #1 0x0000000002b4c114 llvm::sys::RunSignalHandlers() (clang-11+0x2b4c114)
 #2 0x0000000002b4c355 llvm::sys::CleanupOnSignal(unsigned long)
(clang-11+0x2b4c355)
 #3 0x0000000002ac5868 CrashRecoverySignalHandler(int) (clang-11+0x2ac5868)
 #4 0x00007f3d29695630 __restore_rt (/lib64/libpthread.so.0+0xf630)
 #5 0x00007f3d28207387 raise (/lib64/libc.so.6+0x36387)
 #6 0x00007f3d28208a78 abort (/lib64/libc.so.6+0x37a78)
 #7 0x0000000002acd09a (clang-11+0x2acd09a)
 #8 0x00000000030e294e (clang-11+0x30e294e)
 #9 0x0000000003044f3e
clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const*)
(clang-11+0x3044f3e)
#10 0x000000000304326e clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr
const*) (clang-11+0x304326e)
#11 0x0000000003121317 emitPrivatesInit(clang::CodeGen::CodeGenFunction&,
clang::OMPExecutableDirective const&, clang::CodeGen::Address,
clang::CodeGen::LValue, clang::RecordDecl const*, clang::QualType,
clang::QualType, clang::CodeGen::OMPTaskDataTy const&,
llvm::ArrayRef<std::pair<clang::CharUnits, (anonymous
namespace)::PrivateHelpersTy> >, bool) (clang-11+0x3121317)
#12 0x0000000003122fbb
clang::CodeGen::CGOpenMPRuntime::emitTaskInit(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Function*,
clang::QualType, clang::CodeGen::Address, clang::CodeGen::OMPTaskDataTy const&)
(clang-11+0x3122fbb)
#13 0x00000000031244e7
clang::CodeGen::CGOpenMPRuntime::emitTaskCall(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Function*,
clang::QualType, clang::CodeGen::Address, clang::Expr const*,
clang::CodeGen::OMPTaskDataTy const&) (clang-11+0x31244e7)
#14 0x0000000002df782c void llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Function*,
clang::CodeGen::OMPTaskDataTy
const&)>::callback_fn<clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&)::'lambda0'(clang::CodeGen::CodeGenFunction&, llvm::Function*,
clang::CodeGen::OMPTaskDataTy const&)>(long, clang::CodeGen::CodeGenFunction&,
llvm::Function*, clang::CodeGen::OMPTaskDataTy const&) (clang-11+0x2df782c)
#15 0x0000000002e23eee
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&)
(clang-11+0x2e23eee)
#16 0x0000000002e244c2
clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&) (clang-11+0x2e244c2)
#17 0x0000000002df2eed clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>) (clang-11+0x2df2eed)
#18 0x0000000002df315c
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) (clang-11+0x2df315c)
#19 0x0000000002e33147
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(clang-11+0x2e33147)
#20 0x0000000002e418d5
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (clang-11+0x2e418d5)
#21 0x0000000002e790a5
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (clang-11+0x2e790a5)
#22 0x0000000002e76b55
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (clang-11+0x2e76b55)
#23 0x0000000002e7d9df clang::CodeGen::CodeGenModule::EmitDeferred()
(clang-11+0x2e7d9df)
#24 0x0000000002e7da0b clang::CodeGen::CodeGenModule::EmitDeferred()
(clang-11+0x2e7da0b)
#25 0x0000000002e7da0b clang::CodeGen::CodeGenModule::EmitDeferred()
(clang-11+0x2e7da0b)
#26 0x0000000002e7db59 clang::CodeGen::CodeGenModule::Release()
(clang-11+0x2e7db59)
#27 0x00000000038c6857 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(clang-11+0x38c6857)
#28 0x00000000038c439d
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(clang-11+0x38c439d)
#29 0x000000000412aaf9 clang::ParseAST(clang::Sema&, bool, bool)
(clang-11+0x412aaf9)
#30 0x00000000038c4850 clang::CodeGenAction::ExecuteAction()
(clang-11+0x38c4850)
#31 0x00000000032e2209 clang::FrontendAction::Execute() (clang-11+0x32e2209)
#32 0x000000000329fb92
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(clang-11+0x329fb92)
#33 0x000000000338df41
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (clang-11+0x338df41)
#34 0x0000000000c2fd34 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (clang-11+0xc2fd34)
#35 0x0000000000c2c109 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(clang-11+0xc2c109)
#36 0x0000000003182105 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long) (clang-11+0x3182105)
#37 0x0000000002ac5943
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(clang-11+0x2ac5943)
#38 0x0000000003182bd5
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.149) (clang-11+0x3182bd5)
#39 0x000000000315f132
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (clang-11+0x315f132)
#40 0x000000000315faff
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(clang-11+0x315faff)
#41 0x0000000003167c59
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(clang-11+0x3167c59)
#42 0x0000000000b80598 main (clang-11+0xb80598)
#43 0x00007f3d281f3555 __libc_start_main (/lib64/libc.so.6+0x22555)
#44 0x0000000000c2bcc9 _start (clang-11+0xc2bcc9)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 (src/clang/llvm-project/clang
72edb7986a8059cda12b808aa68828af88a0a1eb)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-11: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-11: note: diagnostic msg: /tmp/test_omp_lambda-21dbc0.cpp
clang-11: note: diagnostic msg: /tmp/test_omp_lambda-21dbc0.sh
clang-11: note: diagnostic msg:

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200513/b197db13/attachment.html>


More information about the llvm-bugs mailing list