<html>
<head>
<base href="http://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 --- - AARCH32 asm("b %0":: "i" (3)) should issues a warning"
href="http://llvm.org/bugs/show_bug.cgi?id=22813">22813</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>AARCH32 asm("b %0":: "i" (3)) should issues a warning
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>axelheider@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>follow up from the comments at <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - AARCH64 asm("b %0":: "i" (&someFunc)) broken"
href="show_bug.cgi?id=22761">bug #22761</a>. with LLVM/Clang 3.6 targeting
ARCH322 this compiles without warnings/errors:
__asm ("b %0":: "i" (0)); // 10000004: ea000000 b 1000000c (+0x08)
__asm ("b %0":: "i" (1)); // 10000008: ea000000 b 10000010 (+0x08)
__asm ("b %0":: "i" (2)); // 1000000c: ea000000 b 10000014 (+0x08)
__asm ("b %0":: "i" (3)); // 10000010: ea000000 b 10000018 (+0x08)
__asm ("b %0":: "i" (4)); // 10000014: ea000001 b 10000020 (+0x0C)
But it silently clears out the lower two bits if they are not zero. This should
actually give a warning. In ARM mode any constant must be a multiple of 4, in
TUMB mode it must be a multiple of 2. Anything else cannot even be encoded in
the instruction. So at least a warning here would be nice, like is is done
when targeting AARCH64 here
__asm ("b %0":: "i" (0)); // ok for any multiple of 4
__asm ("b %0":: "i" (1)); // error for any non-multiple of 4
error: expected label or encodable integer pc offset
__asm ("b %0":: "i" (1));
<inline asm>:1:4: note: instantiated into assembly here
b #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>