<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 - InstCombine - Assertion "Compare known true or false was not folded""
href="https://bugs.llvm.org/show_bug.cgi?id=34838">34838</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>InstCombine - Assertion "Compare known true or false was not folded"
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>babokin@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>clang trunk, rev314936, x86_64.
<span class="quote">> cat f.cpp</span >
short a, b, g, h;
int c, e;
unsigned d;
long f;
void i() {
f = unsigned(e) * -1LL + 9223372036854775807L;
if (g * (b == c) - 5)
;
else {
0 / 0 ?: ~~a;
h = (d - f) * 16 != (b == c);
}
}
<span class="quote">> clang++ -w -O2 -c f.cpp</span >
clang-6.0:
/home/dybaboki/llvm/llvm-trunk-20171004/lib/Transforms/InstCombine/InstCombineCompares.cpp:1893:
llvm::Instruction *llvm::InstCombiner::foldICmpShlConstant(llvm::ICmpInst &,
llvm::BinaryOperator *, const llvm::APInt &): Assertion
`C.ashr(*ShiftAmt).shl(*ShiftAmt) == C && "Compare known true or false was not
folded"' failed.
#0 0x000000000135083f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x135083f)
#1 0x0000000001350b46 SignalHandler(int)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x1350b46)
#2 0x00007f20eb910370 __restore_rt (/lib64/libpthread.so.0+0xf370)
#3 0x00007f20ea48c1d7 __GI_raise (/lib64/libc.so.6+0x351d7)
#4 0x00007f20ea48d8c8 __GI_abort (/lib64/libc.so.6+0x368c8)
#5 0x00007f20ea485146 __assert_fail_base (/lib64/libc.so.6+0x2e146)
#6 0x00007f20ea4851f2 (/lib64/libc.so.6+0x2e1f2)
#7 0x0000000001039f5f llvm::InstCombiner::foldICmpShlConstant(llvm::ICmpInst&,
llvm::BinaryOperator*, llvm::APInt const&)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x1039f5f)
#8 0x000000000103dfff
llvm::InstCombiner::foldICmpInstWithConstant(llvm::ICmpInst&)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x103dfff)
#9 0x00000000010482b4 llvm::InstCombiner::visitICmpInst(llvm::ICmpInst&)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x10482b4)
#10 0x0000000000fed2f3 llvm::InstCombiner::run()
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0xfed2f3)
<...></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>