<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 - aarch64 codegen emits add x28,xzr,#1 not accepted by gnu assembler"
href="https://bugs.llvm.org/show_bug.cgi?id=34674">34674</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>aarch64 codegen emits add x28,xzr,#1 not accepted by gnu assembler
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>raj.khem@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>I have a testcase <a href="https://uclibc.org/~kraj/a.cpp">https://uclibc.org/~kraj/a.cpp</a>
Which fails to compile/assemble when using -no-integrated-as on aarch64, but it
works
ok when using -integrated-as
clang -target aarch64-linux-gnu a.cpp -O2 -c -std=gnu++11
works
but
clang -target aarch64-linux-gnu a.cpp -O2 -c -std=gnu++11 -no-integrated-as
throws
/tmp/tmp.ZfaD5q6lwY/a-8fa1ba.s:25688: Error: integer register expected in the
extended/shifted operand register at operand 3 -- `add x28,xzr,#1'
/tmp/tmp.ZfaD5q6lwY/a-8fa1ba.s:25717: Error: integer register expected in the
extended/shifted operand register at operand 3 -- `add x1,xzr,#1'
/tmp/tmp.ZfaD5q6lwY/a-8fa1ba.s:25718: Error: integer register expected in the
extended/shifted operand register at operand 3 -- `add x2,xzr,#1'
I then created .s file output with and without integrated-as and in both cases
I do see above instructions in assmebly file.
I thought it might be a problem only with GNU as so I created a small test case
like this
int foo() {
asm("add x28,xzr,#1") ;
return 0;
}
and now when I compile it, I get errors with both GNU and internal asm
So it does seem that instruction is not accepted by both assemblers but when
using internal assembler and not generating .s files these instructions might
be getting optimized out ?
I think some aarch64 expertise help is needed.</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>