<html>
<head>
<base href="http://llvm.org/bugs/" />
</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 --- - shl by 0 produces the wrong result for i128 on 32bit systems"
href="http://llvm.org/bugs/show_bug.cgi?id=16439">16439</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>shl by 0 produces the wrong result for i128 on 32bit systems
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kfischer@college.harvard.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Consider the following LLVM IR
```
define i128 @julia_foo2599(i32) {
top:
%1 = shl i32 %0, 4
%2 = zext i32 %1 to i128
%3 = shl i128 1, %2
%4 = icmp ugt i32 %1, 127
%5 = select i1 %4, i128 0, i128 %3
ret i128 %5
}
define i32 @main() {
top:
%0 = call i128 @julia_foo2599(i32 0)
%1 = lshr i128 %0, 64
%2 = trunc i128 %1 to i32
ret i32 %2
}
```
Running this in lli, the return code is 1 instead of 0. The actual issue if the
first shl which instead of producing 0x00000000000000000000000000000001
produces 0x00000000000000010000000000000001. This happens of 3.2 as well as on
3.3.</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>