<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 - Store widening makes this code unnecessarily complicated"
href="https://bugs.llvm.org/show_bug.cgi?id=33958">33958</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Store widening makes this code unnecessarily complicated
</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>Linux
</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>hans@chromium.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>$ cat /tmp/a.c
extern int a, b;
void f(int **p) {
p[0] = &a;
p[1] = &b;
}
$ gcc -Os -c /tmp/a.c && objdump -dr a.o
a.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <f>:
0: 48 c7 07 00 00 00 00 movq $0x0,(%rdi)
3: R_X86_64_32S a
7: 48 c7 47 08 00 00 00 movq $0x0,0x8(%rdi)
e: 00
b: R_X86_64_32S b
f: c3
$ bin/clang -Os -c /tmp/a.c && objdump -dr a.o
a.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <f>:
0: b8 00 00 00 00 mov $0x0,%eax
1: R_X86_64_32 b
5: 66 48 0f 6e c0 movq %rax,%xmm0
a: b8 00 00 00 00 mov $0x0,%eax
b: R_X86_64_32 a
f: 66 48 0f 6e c8 movq %rax,%xmm1
14: 66 0f 6c c8 punpcklqdq %xmm0,%xmm1
18: f3 0f 7f 0f movdqu %xmm1,(%rdi)
1c: c3 retq
Doing a 128-bit write is cool, but it's probably not worth it here, especially
when trying to optimize for size :-)</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>