<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] Partially undef i64 generates invalid str (with source = base)."
href="https://llvm.org/bugs/show_bug.cgi?id=28809">28809</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[ARM] Partially undef i64 generates invalid str (with source = base).
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>edy.burt@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>The following function:
char *foo(char *p, char *end, int x) {
long long h;
while(p != end) {
h &= 0xffffffffull;
*(long long*)(p += x) = h;
}
return p;
}
Generates the following assembly on arm-unknown-linux-gnueabihf:
foo(char*, char*, int): @ @foo(char*, char*, int)
cmp r0, r1
bxeq lr
mov r3, #0
.LBB0_1: @ %.lr.ph
str r0, [r0, r2]!
cmp r1, r0
str r3, [r0, #4]
bne .LBB0_1
bx lr
The first store, "str r0, [r0, r2]!", is an invalid opcode.
Trying to put that instruction in inline assembly results in:
<span class="quote">> error: source register and base register can't be identical</span >
However, LLVM (3.8 and later, at least) will happily generate the invalid
instruction, which causes SIGILL if it's ever attempted to be executed.</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>