[Bug inline-asm/87984] [7/8/9 Regression] wrong code for local reg var input to asm
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 17 08:44:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87984
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
CC| |segher at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #10 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Those testcases explicitly clobber the register you use for "a". That of
course will not preserve the contents of "a".
Register variables are hard to use. Avoid them. For passing registers
without there own register class (and constraint) into extended asm, some
new notation like
asm("add %1, %0" : "+r"(o) : "!%%eax"(a));
might work ("!" is not really meaningful in assembler constraints; but a
different character might be better, dunno.)
Maybe something like that can still go into stage 3 if it is simple.
Maybe not. In either case, this PR is invalid.
(Improved documentation would be welcome as well, of course.)
More information about the Gcc-bugs
mailing list