llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.75k stars 11.89k forks source link

[CLANG][ARM] Optional Offset must be set in inline assembler #81520

Open Masmiseim36 opened 8 months ago

Masmiseim36 commented 8 months ago

Hello LLVM Team,

I have come across a behavior that looks like a bug to me. If one of the inline assembler commands strbt, strht or strt is compiled without an optional offset, it is okay for Thumb2, but an error in ARM mode. I have created an example with compiler explorer: https://godbolt.org/z/4x7z3r75b

According to the documentation, the offset should be optional for both thumb mode and ARM mode: https://developer.arm.com/documentation/ddi0403/d/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-ARMv7-M-Thumb-instructions/STRHT https://developer.arm.com/documentation/ddi0406/c/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-instructions/STRHT?lang=en

GCC is fine without the offset in ARM-mode as well as in thumb-mode

llvmbot commented 8 months ago

@llvm/issue-subscribers-backend-arm

Author: Markus Klein (Masmiseim36)

Hello LLVM Team, I have come across a behavior that looks like a bug to me. If one of the inline assembler commands strbt, strht or strt is compiled without an optional offset, it is okay for Thumb2, but an error in ARM mode. I have created an example with compiler explorer: https://godbolt.org/z/4x7z3r75b According to the documentation, the offset should be optional for both thumb mode and ARM mode: https://developer.arm.com/documentation/ddi0403/d/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-ARMv7-M-Thumb-instructions/STRHT https://developer.arm.com/documentation/ddi0406/c/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-instructions/STRHT?lang=en GCC is fine without the offset in ARM-mode as well as in thumb-mode