[llvm-bugs] [Bug 48607] New: Crash during clang openmp codegen for firstprivate() of `float _Complex`, only when debug info is present

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 27 12:05:27 PST 2020


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

            Bug ID: 48607
           Summary: Crash during clang openmp codegen for firstprivate()
                    of `float _Complex`, only when debug info is present
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

I'm not sure if this is a (recent) regression or not.


$ cat input.c
a() {
  float _Complex b;
#pragma omp parallel firstprivate(b)
  ;
}
$ /builddirs/llvm-project/build-Clang11-unknown/bin/clang -O0 -S -emit-llvm
-fopenmp=libomp  -g0 input.c 
input.c:1:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
a() {
^
input.c:5:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
2 warnings generated.
$ /builddirs/llvm-project/build-Clang11-unknown/bin/clang -O0 -S -emit-llvm
-fopenmp=libomp  -g input.c 
input.c:1:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
a() {
^
input.c:5:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
clang: /repositories/llvm-project/llvm/lib/IR/Instructions.cpp:446: void
llvm::CallInst::init(llvm::FunctionType *, llvm::Value *, ArrayRef<llvm::Value
*>, ArrayRef<llvm::OperandBundleDef>, const llvm::Twine &): Assertion `(i >=
FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling
a function with a bad signature!"' 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:
/builddirs/llvm-project/build-Clang11-unknown/bin/clang -O0 -S -emit-llvm
-fopenmp=libomp -g input.c
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      input.c:1:1: Generating code for declaration 'a'
 #0 0x00007fa9372270f3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/repositories/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:13
 #1 0x00007fa9372250c2 llvm::sys::RunSignalHandlers()
/repositories/llvm-project/llvm/lib/Support/Signals.cpp:72:18
 #2 0x00007fa9372266ed llvm::sys::CleanupOnSignal(unsigned long)
/repositories/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
 #3 0x00007fa9371531b3 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/repositories/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:75:5
 #4 0x00007fa937153338 CrashRecoverySignalHandler(int)
/repositories/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:389:1
 #5 0x00007fa93b6f4140 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #6 0x00007fa936b4bc81 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #7 0x00007fa936b35537 abort ./stdlib/abort.c:81:7
 #8 0x00007fa936b3540f get_sysdep_segment_value ./intl/loadmsgcat.c:509:8
 #9 0x00007fa936b3540f _nl_load_domain ./intl/loadmsgcat.c:970:34
#10 0x00007fa936b44602 (/lib/x86_64-linux-gnu/libc.so.6+0x34602)
#11 0x00007fa937739e22 llvm::CallInst::init(llvm::FunctionType*, llvm::Value*,
llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&)
/repositories/llvm-project/llvm/lib/IR/Instructions.cpp:434:3
#12 0x00007fa93a8a87e4 llvm::CallInst::Create(llvm::FunctionType*,
llvm::Value*, llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&,
llvm::Instruction*)
/repositories/llvm-project/llvm/include/llvm/IR/Instructions.h:1513:5
#13 0x00007fa93a8d1b1f llvm::IRBuilderBase::CreateCall(llvm::FunctionType*,
llvm::Value*, llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&,
llvm::MDNode*)
/repositories/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2441:20
#14 0x00007fa93a8cb94f
clang::CodeGen::CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee,
llvm::ArrayRef<llvm::Value*>, llvm::Twine const&)
/repositories/llvm-project/clang/lib/CodeGen/CGCall.cpp:0:0
#15 0x00007fa93a8cb89a
clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(llvm::FunctionCallee,
llvm::ArrayRef<llvm::Value*>, llvm::Twine const&)
/repositories/llvm-project/clang/lib/CodeGen/CGCall.cpp:4193:26
#16 0x00007fa93aa4a745
clang::CodeGen::CGOpenMPRuntime::emitCall(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, llvm::FunctionCallee, llvm::ArrayRef<llvm::Value*>)
const /repositories/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:0:11
#17 0x00007fa93aaaf8ee
clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(clang::CapturedStmt
const&, clang::SourceLocation)
/repositories/llvm-project/clang/lib/CodeGen/CGStmtOpenMP.cpp:0:26
#18 0x00007fa93aa1d2ec
emitParallelOrTeamsOutlinedFunction(clang::CodeGen::CodeGenModule&,
clang::OMPExecutableDirective const&, clang::CapturedStmt const*,
clang::VarDecl const*, llvm::omp::Directive, llvm::StringRef,
clang::CodeGen::RegionCodeGenTy const&)
/repositories/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:0:14
#19 0x00007fa93aa1d05a
clang::CodeGen::CGOpenMPRuntime::emitParallelOutlinedFunction(clang::OMPExecutableDirective
const&, clang::VarDecl const*, llvm::omp::Directive,
clang::CodeGen::RegionCodeGenTy const&)
/repositories/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1278:3
#20 0x00007fa93aab86fa
emitCommonOMPParallelDirective(clang::CodeGen::CodeGenFunction&,
clang::OMPExecutableDirective const&, llvm::omp::Directive,
clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&,
llvm::SmallVectorImpl<llvm::Value*>&)> const&)
/repositories/llvm-project/clang/lib/CodeGen/CGStmtOpenMP.cpp:1532:40
#21 0x00007fa93aab80b1
clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(clang::OMPParallelDirective
const&) /repositories/llvm-project/clang/lib/CodeGen/CGStmtOpenMP.cpp:1751:5
#22 0x00007fa93aa9d1e2 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
/repositories/llvm-project/clang/lib/CodeGen/CGStmt.cpp:0:5
#23 0x00007fa93aaa7e0c
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
/repositories/llvm-project/clang/lib/CodeGen/CGStmt.cpp:441:22
#24 0x00007fa93ab04e24
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
/repositories/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1189:7
#25 0x00007fa93ab057d7 clang::CodeGen::CodeGenFunction::getLangOpts() const
/repositories/llvm-project/clang/lib/CodeGen/CodeGenFunction.h:1894:51
#26 0x00007fa93ab057d7
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
/repositories/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1363:7
#27 0x00007fa93ab237de
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
/repositories/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:0:26
#28 0x00007fa93ab1c6d5
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
/repositories/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:0:12
#29 0x00007fa93ab11780 __gnu_cxx::__normal_iterator<clang::CXXRecordDecl const*
const*, std::vector<clang::CXXRecordDecl const*,
std::allocator<clang::CXXRecordDecl const*> >
>::__normal_iterator(clang::CXXRecordDecl const* const* const&)
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator.h:979:20
#30 0x00007fa93ab11780 std::vector<clang::CXXRecordDecl const*,
std::allocator<clang::CXXRecordDecl const*> >::begin() const
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:821:16
#31 0x00007fa93ab11780 std::vector<clang::CXXRecordDecl const*,
std::allocator<clang::CXXRecordDecl const*> >::empty() const
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:1008:16
#32 0x00007fa93ab11780 clang::CodeGen::CodeGenModule::EmitDeferred()
/repositories/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2330:26
#33 0x00007fa93ab102b9 clang::CodeGen::CodeGenModule::Release()
/repositories/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:448:3
#34 0x00007fa93abb6504 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
/repositories/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:271:11
#35 0x00007fa93aaf96ad
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/repositories/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:294:13
#36 0x00007fa9347e57e4
__gnu_cxx::__normal_iterator<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >*,
std::vector<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >,
std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> > > >
>::__normal_iterator(std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >* const&)
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator.h:979:20
#37 0x00007fa9347e57e4
std::vector<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >,
std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> > > >::begin()
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:812:16
#38 0x00007fa9347e57e4 void
clang::finalize<std::vector<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >,
std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> > > >
>(std::vector<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >,
std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> > > >&, clang::Sema
const&)
/repositories/llvm-project/clang/include/clang/Sema/TemplateInstCallback.h:54:16
#39 0x00007fa9347e57e4 clang::ParseAST(clang::Sema&, bool, bool)
/repositories/llvm-project/clang/lib/Parse/ParseAST.cpp:178:3
#40 0x00007fa938f82440 clang::FrontendAction::Execute()
/repositories/llvm-project/clang/lib/Frontend/FrontendAction.cpp:953:10
#41 0x00007fa938f19232 llvm::Error::getPtr() const
/repositories/llvm-project/llvm/include/llvm/Support/Error.h:274:42
#42 0x00007fa938f19232 llvm::Error::operator bool()
/repositories/llvm-project/llvm/include/llvm/Support/Error.h:236:16
#43 0x00007fa938f19232
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/repositories/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:957:23
#44 0x00007fa93b6d5de8 std::__shared_ptr<clang::CompilerInvocation,
(__gnu_cxx::_Lock_policy)2>::get() const
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:1325:16
#45 0x00007fa93b6d5de8 std::__shared_ptr_access<clang::CompilerInvocation,
(__gnu_cxx::_Lock_policy)2, false, false>::_M_get() const
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:1024:66
#46 0x00007fa93b6d5de8 std::__shared_ptr_access<clang::CompilerInvocation,
(__gnu_cxx::_Lock_policy)2, false, false>::operator->() const
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:1018:9
#47 0x00007fa93b6d5de8 clang::CompilerInstance::getFrontendOpts()
/repositories/llvm-project/clang/include/clang/Frontend/CompilerInstance.h:286:12
#48 0x00007fa93b6d5de8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/repositories/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:279:14
#49 0x0000000000219e00 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /repositories/llvm-project/clang/tools/driver/cc1_main.cpp:0:0
#50 0x000000000021767e ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/repositories/llvm-project/clang/tools/driver/driver.cpp:0:12
#51 0x00007fa938c98e92
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::$_1::operator()() const
/repositories/llvm-project/clang/lib/Driver/Job.cpp:404:30
#52 0x00007fa938c98e92 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::$_1>(long)
/repositories/llvm-project/llvm/include/llvm/ADT/STLExtras.h:185:12
#53 0x00007fa9371530c8 llvm::function_ref<void ()>::operator()() const
/repositories/llvm-project/llvm/include/llvm/ADT/STLExtras.h:0:12
#54 0x00007fa9371530c8
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
/repositories/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:424:3
#55 0x00007fa938c983d3
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
/repositories/llvm-project/clang/lib/Driver/Job.cpp:404:7
#56 0x00007fa938c65a10 std::_Function_base::_M_empty() const
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:248:37
#57 0x00007fa938c65a10 std::function<void (clang::driver::Command const&,
int)>::operator bool() const
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:499:17
#58 0x00007fa938c65a10
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
/repositories/llvm-project/clang/lib/Driver/Compilation.cpp:196:7
#59 0x00007fa938c65ec3
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
/repositories/llvm-project/clang/lib/Driver/Compilation.cpp:248:13
#60 0x00007fa938c7dd2e llvm::SmallVectorBase<unsigned int>::empty() const
/repositories/llvm-project/llvm/include/llvm/ADT/SmallVector.h:75:47
#61 0x00007fa938c7dd2e
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
/repositories/llvm-project/clang/lib/Driver/Driver.cpp:1515:23
#62 0x00000000002169d9 main
/repositories/llvm-project/clang/tools/driver/driver.cpp:505:9
#63 0x00007fa936b36d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#64 0x0000000000213ffa _start
(/builddirs/llvm-project/build-Clang11-unknown/bin/clang+0x213ffa)
clang-12: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 12.0.0 (git at github.com:LebedevRI/llvm-project.git
0af42d3dc73e8f08e37811131c31358ecb9adf20)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /builddirs/llvm-project/build-Clang11-unknown/bin
clang-12: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/input-522267.c
clang-12: note: diagnostic msg: /tmp/input-522267.sh
clang-12: 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/20201227/7defa914/attachment-0001.html>


More information about the llvm-bugs mailing list