<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - fatal error with #pragma omp critical"
href="https://bugs.llvm.org/show_bug.cgi?id=44893">44893</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>fatal error with #pragma omp critical
</td>
</tr>
<tr>
<th>Product</th>
<td>OpenMP
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>compile-fail, regression
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Clang Compiler Support
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>v.reichelt@netcologne.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following valid code snippet triggers a fatal error when compiled with
"-fopenmp -O -g".
==========================
void foo()
{
#pragma omp critical
;
}
void bar()
{
foo();
foo();
}
==========================
This is a recent regression on trunk introduced between commits c29003813ab
(OK) and 6646f315c06 (broken).
Instruction does not dominate all uses!
%.kmpc_loc.addr.i1 = alloca %struct.ident_t, align 8
%0 = call i32 @__kmpc_global_thread_num(%struct.ident_t* nonnull
%.kmpc_loc.addr.i1)
in function _Z3barv
fatal error: error in backend: Broken function found, compilation aborted!
Stack dump:
0. Program arguments: /LLVM-trunk/bin/clang++ -fopenmp -O -g -c bug.cc
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'bug.cc'.
4. Running pass 'Module Verifier' on function '@_Z3barv'
#0 0x00000000027ae8da llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/LLVM-trunk/bin/clang+++0x27ae8da)
#1 0x00000000027ac444 llvm::sys::RunSignalHandlers()
(/LLVM-trunk/bin/clang+++0x27ac444)
#2 0x00000000027ac69b llvm::sys::CleanupOnSignal(unsigned long)
(/LLVM-trunk/bin/clang+++0x27ac69b)
#3 0x000000000272815f llvm::CrashRecoveryContext::HandleExit(int)
(/LLVM-trunk/bin/clang+++0x272815f)
#4 0x00000000027a5197 llvm::sys::Process::Exit(int)
(/LLVM-trunk/bin/clang+++0x27a5197)
#5 0x00000000008f2c75 LLVMErrorHandler(void*, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)
(/LLVM-trunk/bin/clang+++0x8f2c75)
#6 0x0000000002730342 llvm::report_fatal_error(llvm::Twine const&, bool)
(/LLVM-trunk/bin/clang+++0x2730342)
#7 0x0000000002730470
llvm::report_fatal_error(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)
(/LLVM-trunk/bin/clang+++0x2730470)
#8 0x000000000215f7e3 (anonymous
namespace)::VerifierLegacyPass::runOnFunction(llvm::Function&)
(/LLVM-trunk/bin/clang+++0x215f7e3)
#9 0x00000000020ee8b7 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/LLVM-trunk/bin/clang+++0x20ee8b7)
#10 0x00000000020ef379 llvm::FPPassManager::runOnModule(llvm::Module&)
(/LLVM-trunk/bin/clang+++0x20ef379)
#11 0x00000000020ef70e llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/LLVM-trunk/bin/clang+++0x20ef70e)
#12 0x00000000029e796d (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/LLVM-trunk/bin/clang+++0x29e796d)
#13 0x00000000029e9050 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/LLVM-trunk/bin/clang+++0x29e9050)
#14 0x0000000003520518
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/LLVM-trunk/bin/clang+++0x3520518)
#15 0x0000000003f08119 clang::ParseAST(clang::Sema&, bool, bool)
(/LLVM-trunk/bin/clang+++0x3f08119)
#16 0x000000000351f218 clang::CodeGenAction::ExecuteAction()
(/LLVM-trunk/bin/clang+++0x351f218)
#17 0x0000000002f36659 clang::FrontendAction::Execute()
(/LLVM-trunk/bin/clang+++0x2f36659)
#18 0x0000000002ef9f92
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/LLVM-trunk/bin/clang+++0x2ef9f92)
#19 0x0000000002ffc820
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/LLVM-trunk/bin/clang+++0x2ffc820)
#20 0x00000000008f3a4b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/LLVM-trunk/bin/clang+++0x8f3a4b)
#21 0x00000000008efc97 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/LLVM-trunk/bin/clang+++0x8efc97)
#22 0x0000000002dda305 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/LLVM-trunk/bin/clang+++0x2dda305)
#23 0x0000000002728032
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/LLVM-trunk/bin/clang+++0x2728032)
#24 0x0000000002ddade5
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const (.part.168)
(/LLVM-trunk/bin/clang+++0x2ddade5)
#25 0x0000000002db7947
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/LLVM-trunk/bin/clang+++0x2db7947)
#26 0x0000000002db8227
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/LLVM-trunk/bin/clang+++0x2db8227)
#27 0x0000000002dc04e1
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/LLVM-trunk/bin/clang+++0x2dc04e1)
#28 0x0000000000859ed3 main (/LLVM-trunk/bin/clang+++0x859ed3)
clang-11: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
3f3ec9c40b2574929b41b93ac38484081b49837b)
Target: x86_64-unknown-linux-gnu
Thread model: posix</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>