<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 - Passing memory references to inline assembler does not accept 'c' modifier on ARM32"
href="https://bugs.llvm.org/show_bug.cgi?id=40959">40959</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Passing memory references to inline assembler does not accept 'c' modifier on ARM32
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>8.0
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>frank.mehnert@kernkonzept.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Consider the following example:
static void foo()
{
}
int main(void)
{
asm volatile (".pushsection \".data\"\n"
".long %c[foo]\n"
".popsection\n"
:
: [foo] "i" (&foo));
return 0;
}
The intention is to code the address of foo() into the data segment. This code
does not compile with
clang-8 --target=arm-linux-gnueabi -O2 -o bar bar.c -fno-pic
but it successfully compiles if the 'c' modifier is omitted:
asm volatile (".pushsection \".data\"\n"
".long %[foo]\n"
".popsection\n"
Same code on ARM64 compiles fine:
asm volatile (".pushsection \".data\"\n"
".8byte %c[foo]\n"
".popsection\n"
I believe that specifying the 'c' modifier is correct. Gcc always demans on it
and does not compile without the 'c' modifier.</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>