<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 --- - shrink-wraping missing"
href="https://llvm.org/bugs/show_bug.cgi?id=29154">29154</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>shrink-wraping missing
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>danielcdh@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>struct x {
int bar();
};
struct y {
int foo();
struct x *m_;
int n_;
};
int y::foo() {
if (m_ == 0)
return -1;
int n;
do { (n) = __atomic_load_n((&n_), 0); } while (0);
if (__builtin_expect(n == -1, 0)) {
n = m_->bar();
__atomic_store_n((&n_), (n), 0);
}
return n;
}
built with -fno-omit-frame-pointer -O2
gcc version:
cmpq $0, (%rdi)
je .L3
movl 8(%rdi), %eax
cmpl $-1, %eax
je .L9
ret
....
llvm version:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rdi
movl $-1, %eax
testq %rdi, %rdi
je .LBB0_3
movl 8(%rbx), %eax
cmpl $-1, %eax
je .LBB0_2
.LBB0_3:
addq $8, %rsp
popq %rbx
popq %rbp
retq
......
GCC takes 6 instructions while llvm takes 16</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>