<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 - Crash from r316869"
href="https://bugs.llvm.org/show_bug.cgi?id=35210">35210</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash from r316869
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>Severity</th>
<td>release blocker
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dlj@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>(Somewhat) reduced test case:
<a href="https://reviews.llvm.org/P8043">https://reviews.llvm.org/P8043</a>
=====
template <typename T>
struct TempPtr {
explicit TempPtr(T* ptr) : p_(ptr) {}
~TempPtr() { delete p_; }
T* leak() const {
T* ptr = p_;
p_ = 0;
return ptr;
}
mutable T* p_;
};
template <typename T>
struct Ptr {
Ptr(TempPtr<T>&& o) : p_(o.leak()) {}
TempPtr<T> release() {
T* ptr = p_;
p_ = 0;
return TempPtr<T>(ptr);
}
T* operator->() const {
if (!p_) __builtin_trap();
return p_;
}
operator bool() const { return p_; }
T* p_;
};
struct C {
~C();
Ptr<C> x_;
};
struct Deleter {
void handle(TempPtr<C>&&);
};
C::~C()
{
if (!x_)
return;
Deleter d;
Ptr<C> current = x_.release();
while (true) {
Ptr<C> next = current->x_.release();
d.handle(current.release());
if (!next)
break;
current = next.release();
}
}
=====
bin/clang -cc1 -triple x86_64-grtev4-linux-gnu -emit-obj -O3 -std=gnu++11
-fexperimental-new-pass-manager -x c++ crasher.cc
Gives me this error (edited for brevity):
=====
#0 llvm::sys::RunSignalHandlers()
#1 SignalHandler(int)
#2 __restore_rt
#3 llvm::IDFCalculator<llvm::Inverse<llvm::BasicBlock*>,
true>::calculate(llvm::SmallVectorImpl<llvm::BasicBlock*>&)
#4 (anonymous
namespace)::AggressiveDeadCodeElimination::performDeadCodeElimination()
#5 llvm::ADCEPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
#6 llvm::detail::PassModel<llvm::Function, llvm::ADCEPass,
llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
#7 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
#8 llvm::CGSCCToFunctionPassAdaptor<llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function>> >::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
#9 llvm::detail::PassModel<llvm::LazyCallGraph::SCC,
llvm::CGSCCToFunctionPassAdaptor<llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function>> >, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
#10 llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
#11 llvm::DevirtSCCRepeatedPass<llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>
<span class="quote">>::run(llvm::LazyCallGraph::SCC&,</span >
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
#12
llvm::ModuleToPostOrderCGSCCPassAdaptor<llvm::DevirtSCCRepeatedPass<llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&> > >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
#13 llvm::detail::PassModel<llvm::Module,
llvm::ModuleToPostOrderCGSCCPassAdaptor<llvm::DevirtSCCRepeatedPass<llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&> > >, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
#14 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
#15 llvm::detail::PassModel<llvm::Module, llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module>>, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
#16 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
#17 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> >)
#18 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
#19 clang::ParseAST(clang::Sema&, bool, bool)
#20 clang::FrontendAction::Execute()
#21 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
#22 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
#23 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
#24 main
#25 __libc_start_main
#26 _start
Stack dump:
0. Program arguments: bin/clang -cc1 -triple x86_64-grtev4-linux-gnu
-emit-obj -O3 -std=gnu++11 -fexperimental-new-pass-manager -x c++
/tmp/crasher.cpp
1. <eof> parser at end of file
2. Optimizer
=====
Reverting r316869 fixes the crash.</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>