<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 --- - Integrated assembler rejects ldrexd/strexd in thumb mode"
href="https://llvm.org/bugs/show_bug.cgi?id=31058">31058</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Integrated assembler rejects ldrexd/strexd in thumb mode
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>sbc@chromium.org
</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>These instructions are apparently valid in thumb2 mode but clang's integrated
asm rejects them:
void func() {
int volatile *ptr;
int ret;
__asm__ __volatile__("ldrexd %0,[%1]\n"
: "=&r" (ret)
: "r" (ptr)
: "cc", "memory"
);
}
$ clang --target=arm-linux-gnueabihf -march=armv7-a -o test.o -c test.c
-mthumb
test.c:4:24: error: instruction requires: arm-mode
__asm__ __volatile__("ldrexd %0,[%1]\n"
^
<inline asm>:1:2: note: instantiated into assembly here
ldrexd r1,[r0]
^
1 error generated.
With -no-integrated-as the same code compiles fine:
See <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=564059">https://bugs.chromium.org/p/chromium/issues/detail?id=564059</a></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>