Fix Extended Asm ignored constraintsmob
commit0703df1a6a8215c74f4f4a20aa9270eff1397733
authorEkaitz Zarraga <ekaitz@elenq.tech>
Mon, 15 Apr 2024 14:21:39 +0000 (15 16:21 +0200)
committerEkaitz Zarraga <ekaitz@elenq.tech>
Tue, 16 Apr 2024 00:47:56 +0000 (16 02:47 +0200)
tree3c1dfe5f9b01fd02d59702e89e60d6961da22681
parent4944f509c357a0c9867a9f4dc5f4be48498cc1c3
Fix Extended Asm ignored constraints

This commit fixes the case where the register of for the Extended Asm
input or output is known. Before this commit, the following case:

  register long __a0 asm ("a0") = one;
  asm volatile (
       "ecall\n\t"
       : "+r" (__a0) // NOTE the +r here
  );

Didn't treat `a0` as an input+output register (+ contraint) as the code
skipped the constraint processing when the register was already chosen
(instead of allocated later).

This issue comes from f081acbfba84ffdf1e479f932906bf10f88cd1c2, that was
taken as a reference in every other Extended Assembler implementation.
arm-asm.c
i386-asm.c
riscv64-asm.c