[Bug inline-asm/97708] Inline asm does not use the local register asm specified with register ... asm() as input
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 4 17:52:08 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97708
--- Comment #21 from Segher Boessenkool <segher at gcc dot gnu.org> ---
register float foo asm ("xmm0") = 0.99f;
asm volatile("movl %0, %%r8d\n\t"
"vmcall\n\t"
:: "g" (foo));
The user said operands[0] should go in xmm0, but that hard reg is not
valid for its constraint.
"""
Then use the local variable for the asm operand and specify any constraint
letter that matches the register:
"""
Not following that rule, causing a reload, is the user error. The reload
you get is diametrically opposite to what local register vars are *for*,
so it would be good if we could give an error.
More information about the Gcc-bugs
mailing list