[llvm-bugs] [Bug 27250] aarch64 inline assembly adds number as "#24" instead of plain "24" in the context of .set

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 8 09:55:06 PDT 2016


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

Renato Golin <renato.golin at linaro.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Renato Golin <renato.golin at linaro.org> ---
To be clear, what's going on here is that in AArch64, ARM ARM (C1.2), the
assembler is allowed (but not compelled) to not use hashes for immediates,
which is not true for ARMv7 and previous.

Whoever wrote that code abused of a specific behaviour that was not intended
for that kind of inline asm constraint. There is nothing to fix in the
compiler, since the code is not invalid. We just need to find another
constraint code to make it output expressions, rather than immediates.

The proper fix is to change the code to:

void foo () {
  asm(".globl test; .set test, %c0" :: "I"(24));
}

Works on ARM and AArch64, GCC and Clang.

(hat tip to Jim Wilson)

-- 
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/20160408/7ce1da7b/attachment.html>


More information about the llvm-bugs mailing list