<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 - [InstSimplify] Miscompilation of sdiv + udiv"
href="https://bugs.llvm.org/show_bug.cgi?id=32949">32949</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[InstSimplify] Miscompilation of sdiv + udiv
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>miscompilation
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</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>nunoplopes@sapo.pt
</td>
</tr>
<tr>
<th>CC</th>
<td>david.majnemer@gmail.com, llvm-bugs@lists.llvm.org, regehr@cs.utah.edu, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>InstSimplify miscompiles the following:
define i2 @func68396950(i2) {
%2 = sdiv exact i2 1, %0
%3 = sdiv exact i2 -1, %0
%4 = udiv i2 %2, %3
ret i2 %4
}
$ opt -S a.ll -instsimplify
define i2 @func68396950(i2) {
ret i2 0
}
Alive says:
ERROR: Mismatch in values of i2 ret_
Example:
%0 i2 = 0x3 (3, -1)
%2 i2 = 0x3 (3, -1)
%3 i2 = 0x1 (1)
%4 i2 = 0x3 (3, -1)
Source value: 0x3 (3, -1)
Target value: 0x0 (0)
<a href="http://rise4fun.com/Alive/5mO">http://rise4fun.com/Alive/5mO</a></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>