https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89334

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If you are using inline asm, you need to know what you are doing.
https://gcc.gnu.org/onlinedocs/gcc-8.2.0/gcc/Simple-Constraints.html#Simple-Constraints
‘r’
    A register operand is allowed provided that it is in a general register. 
while q is:
https://gcc.gnu.org/onlinedocs/gcc-8.2.0/gcc/Machine-Constraints.html#Machine-Constraints
‘q’
    Any register accessible as rl. In 32-bit mode, a, b, c, and d; in 64-bit
mode, any integer register.
By using r constraint, you tell the compiler it is ok to allocate that value in
any gpr register, so for 32-bit mode eax, ebx, ecx, edx, esi, edi, ebp (or, in
theory esp, though that is fixed register).
That would be ok if the assembly pattern used e.g. %k1 instead of %1.  But as
you want to use the %?l in there, you need to tell the compiler that it may
only use the selected registers, otherwise it is a lottery.  It can compile
fine, if you are lucky and the compiler chooses the eax/ebx/ecx/edx registers,
or it can fail the way it failed for you.

Reply via email to