<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 - opt crashes with "opt -inline -instcombine -adce -newgvn -gvn-hoist": Assertion `dominates(MD, U) && "Memory Def does not dominate it's uses"' failed"
href="https://bugs.llvm.org/show_bug.cgi?id=34459">34459</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>opt crashes with "opt -inline -instcombine -adce -newgvn -gvn-hoist": Assertion `dominates(MD, U) && "Memory Def does not dominate it's uses"' failed
</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>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>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>su@cs.ucdavis.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>$ clang -v
clang version 6.0.0 (trunk 312462)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang -w -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ opt -inline -instcombine -adce -newgvn -gvn-hoist -o small-opt.bc small.bc
opt: /tmp/llvm-builder/llvm-source-trunk/lib/Analysis/MemorySSA.cpp:1715: void
llvm::MemorySSA::verifyDomination(llvm::Function&) const: Assertion
`dominates(MD, U) && "Memory Def does not dominate it's uses"' failed.
#0 0x0000000001e5966a (opt+0x1e5966a)
#1 0x0000000001e573de (opt+0x1e573de)
#2 0x0000000001e57552 (opt+0x1e57552)
#3 0x00007f4159b0d390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f415887f428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f415888102a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f4158877bd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#7 0x00007f4158877c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x000000000142c9a7 (opt+0x142c9a7)
#9 0x000000000142c9e9 (opt+0x142c9e9)
#10 0x000000000193c509 (opt+0x193c509)
#11 0x000000000194023a (opt+0x194023a)
#12 0x000000000137596e (opt+0x137596e)
#13 0x000000000193fe7d (opt+0x193fe7d)
#14 0x00000000006f30d6 (opt+0x6f30d6)
#15 0x00007f415886a830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#16 0x0000000000765a09 (opt+0x765a09)
Stack dump:
0. Program arguments: opt -inline -instcombine -adce -newgvn -gvn-hoist -o
small-opt.bc small.bc
1. Running pass 'CallGraph Pass Manager' on module 'small.bc'.
Aborted (core dumped)
$
---------------------------------------------------
int a, b, c, e, f, g, h, i, j, k;
char d;
int fn1 (int l)
{
return a ? l : a;
}
char fn2 ()
{
return b ? d : b;
}
int fn3 (int l)
{
return l ? l : c;
}
int fn4 ()
{
return e ? e : f;
}
void fn5 ()
{
while (j)
;
if (1 | ((g || fn1 (fn2 () > i)) > 0))
;
else
{
L:
fn3 ((h && 0, fn4 ()));
if (k)
goto L;
}
}
int main ()
{
fn5 ();
return 0;
}</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>