[llvm-bugs] [Bug 34674] New: aarch64 codegen emits add x28, xzr, #1 not accepted by gnu assembler

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 19 13:37:10 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34674

            Bug ID: 34674
           Summary: aarch64 codegen emits add x28,xzr,#1 not accepted by
                    gnu assembler
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: raj.khem at gmail.com
                CC: llvm-bugs at lists.llvm.org

I have a testcase https://uclibc.org/~kraj/a.cpp

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170919/bb65fc19/attachment.html>


More information about the llvm-bugs mailing list