<html>
<head>
<base href="https://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 --- - Miscompile involving AssertZext on x86-64"
href="https://llvm.org/bugs/show_bug.cgi?id=28540">28540</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Miscompile involving AssertZext on x86-64
</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>Windows NT
</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>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eli.friedman@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mkuper@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Testcase:
define void @f(i64 %a, i64* %x, i64* %y) {
; CHECK-LABEL: main
; CHECK: movl %ecx, %eax
; CHECK: ret
%aa = and i64 %a, -1152921504606781441
store i64 %aa, i64* %y
%trunc = trunc i64 %aa to i32
br label %l
l:
%ext = zext i32 %trunc to i64
store i64 %ext, i64* %x
ret void
}
define i32 @main() {
%x = alloca i64
%y = alloca i64
call void @f(i64 -1, i64* %x, i64* %y)
%yy = load i64, i64* %x
%c = icmp slt i64 %yy, 0
br i1 %c, label %abort, label %end
abort:
call void @abort()
unreachable
end:
ret i32 0
}
declare void @abort()
Aborts with "llc", runs successfully with "llc -O0", trunk LLVM on Linux
x86-64.
Inspired by r221672 / <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - wrong code at -O2 and -O3 on x86_64-linux-gnu (only in 64-bit mode and affecting all clang versions) (scalar division)"
href="show_bug.cgi?id=20494">bug 20494</a>. The def32 pattern is extremely fragile.</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>