<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 - clang crashes with "-mllvm -enable-newgvn": Assertion `ProcessedCount[V] < 100 && "Seem to have processed the same Value a lot"' failed"
href="https://bugs.llvm.org/show_bug.cgi?id=33432">33432</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang crashes with "-mllvm -enable-newgvn": Assertion `ProcessedCount[V] < 100 && "Seem to have processed the same Value a lot"' failed
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>helloqirun@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following code crashes the current trunk version at "-O2" and above with
"-mllvm -enable-newgvn". Level "-O1" works fine.
$ clang-trunk -v
clang version 5.0.0 (trunk 305182)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang-trunk -mllvm -enable-newgvn -O2 abc.c
clang-5.0: /home/absozero/trunk/llvm/lib/Transforms/Scalar/NewGVN.cpp:2722:
void (anonymous namespace)::NewGVN::updateProcessedCount(const llvm::Value *):
Assertion `ProcessedCount[V] < 100 && "Seem to have processed the same Value a
lot"' failed.
#0 0x0000000001d0d854 PrintStackTraceSignalHandler(void*)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1d0d854)
#1 0x0000000001d0db76 SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1d0db76)
#2 0x00007f41165f7330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x00007f4115174c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007f4115178028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007f411516dbf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#6 0x00007f411516dca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#7 0x0000000001c05d39 (anonymous
namespace)::NewGVN::updateProcessedCount(llvm::Value const*)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1c05d39)
#8 0x0000000001bfdcbb (anonymous
namespace)::NewGVN::iterateTouchedInstructions()
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1bfdcbb)
#9 0x0000000001bf4fcb (anonymous namespace)::NewGVN::runGVN()
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1bf4fcb)
#10 0x0000000001bfa6c6 (anonymous
namespace)::NewGVNLegacyPass::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1bfa6c6)
#11 0x00000000018926cf llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x18926cf)
#12 0x000000000272bd16 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x272bd16)
#13 0x0000000001892e25 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1892e25)
#14 0x0000000001e9923b 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> >)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x1e9923b)
#15 0x00000000025b8e27
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x25b8e27)
#16 0x0000000002a24136 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x2a24136)
#17 0x000000000227c748 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x227c748)
#18 0x000000000222d3d1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x222d3d1)
#19 0x000000000230309a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x230309a)
#20 0x00000000008444c4 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang-5.0+0x8444c4)
#21 0x000000000084204c main
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x84204c)
#22 0x00007f411515ff45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#23 0x000000000083f4c9 _start
(/home/absozero/trunk/root-clang/bin/clang-5.0+0x83f4c9)
Stack dump:
0. Program arguments: /home/absozero/trunk/root-clang/bin/clang-5.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name abc.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/home/absozero/trunk/root-clang/lib/clang/5.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/lib/clang/5.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdebug-compilation-dir /home/absozero/projects/reduction/crash -ferror-limit
19 -fmessage-length 172 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -enable-newgvn -o
/tmp/abc-2ef3ff.o -x c abc.c
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module 'abc.c'.
4. Running pass 'Global Value Numbering' on function '@fn1'
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (trunk 305182)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-5.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-5.0: note: diagnostic msg: /tmp/abc-9be5eb.c
clang-5.0: note: diagnostic msg: /tmp/abc-9be5eb.sh
clang-5.0: note: diagnostic msg:
********************
$ cat abc.c
char a, b, e;
short c;
int d;
void fn1() {
if (0)
for (; e;) {
int f = 8;
for (; b;) {
c = b = 0;
for (; b <= 6;)
b *= f;
f = c;
l1:;
}
a *= d | f;
}
else
goto l1;
}</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>