[llvm] [ARM][TableGen][MC] Change the ARM mnemonic operands to be optional for ASM parsing (PR #83436)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 10:43:37 PDT 2024


dyung wrote:

Hi @AlfieRichardsArm we are seeing a case with inline asm that no longer compiles after your change. Consider the following code:
```c
void a() {
  __asm("strexd r0, r2, [r3]");
  __asm("ldrexd r0, [r2]");
}
```
Prior to your change, this compiled successfully:
```
$ ~/src/upstream/3e6db602918435b6a5ac476f63f8b259e7e73af4-linux/bin/clang --target=armv7a-unknown-eabi -c min2.c
```
But after your change, the compiler is now emitting errors for the same code:
```
$ ~/src/upstream/295cdd5c3dbd14406bf9cce01e3dfd787fb1ddda-linux/bin/clang --target=armv7a-unknown-eabi -c min2.c
min2.c:2:9: error: invalid operand for instruction
    2 |   __asm("strexd r0, r2, [r3]");
      |         ^
<inline asm>:1:13: note: instantiated into assembly here
    1 |         strexd r0, r2, [r3]
      |                    ^
min2.c:3:9: error: invalid operand for instruction
    3 |   __asm("ldrexd r0, [r2]");
      |         ^
<inline asm>:1:9: note: instantiated into assembly here
    1 |         ldrexd r0, [r2]
      |                ^
2 errors generated.
```
Is this expected?

https://github.com/llvm/llvm-project/pull/83436


More information about the llvm-commits mailing list