<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 --- - arm assembler does not share constant pool"
href="https://llvm.org/bugs/show_bug.cgi?id=24560">24560</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>arm assembler does not share constant pool
</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>Linux
</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: Cell SPU
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>chh@google.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>Arm target assembler should share constants in the constant pool.
Input: x.s
.arm
.text
.global foo1
foo1:
PUSH {r4-r6,lr}
LDR r7, =0x80808080
LDR r7, =0x80808080
POP {r4-r6,pc}
.global foo2
foo2:
PUSH {r4-r6,lr}
LDR r7, =0x80808080
POP {r4-r6,pc}
.global foo3
.end
Compile with:
clang -target arm-linux-gnu -c -o x.o x.s
Objdump showed 3 instances of the constant 0x80808080:
00000000 <foo1>:
0: e92d4070 push {r4, r5, r6, lr}
4: e59f7010 ldr r7, [pc, #16] ; 1c <foo2+0xc>
8: e59f7010 ldr r7, [pc, #16] ; 20 <foo2+0x10>
c: e8bd8070 pop {r4, r5, r6, pc}
00000010 <foo2>:
10: e92d4070 push {r4, r5, r6, lr}
14: e59f7008 ldr r7, [pc, #8] ; 24 <foo2+0x14>
18: e8bd8070 pop {r4, r5, r6, pc}
1c: 80808080 addhi r8, r0, r0, lsl #1
20: 80808080 addhi r8, r0, r0, lsl #1
24: 80808080 addhi r8, r0, r0, lsl #1</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>