[Bug inline-asm/97708] Inline asm does not use the local register asm specified with register ... asm() as input

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 5 11:04:22 GMT 2020


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

--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Even if we wanted to do something about it (which I disagree with, e.g. given
that the implementation matches the documentation), you run into the problem
that even GIMPLE nor RTL differentiates between:
void
foo (void)
{
  register int a __asm ("eax") = 1;
  __asm ("# %0 " : : "c" (a+0));
  __asm ("# %0 " : : "c" (a));
}
And "c" (a+0) unquestionably must be valid, it is just an expression that
happens to be equal to a value of local register variable.


More information about the Gcc-bugs mailing list