[Bug inline-asm/87733] local register variable not honored with earlyclobber
bugdal at aerifal dot cx
gcc-bugzilla@gcc.gnu.org
Sat Mar 14 23:36:10 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87733
--- Comment #27 from Rich Felker <bugdal at aerifal dot cx> ---
Also just realized:
> Rich, forcing "n" to be in "$r10" seems to do the trick? Is that a reasonable
solution for you?
It doesn't even work, because the syscall clobbers basically all call-clobbered
registers. Current kernels are preserving at least $25 (t9) and $28 (gp) and
the syscall argument registers, so $25 may be usable, but it was deemed not
clear in 2012. I'm looking back through musl git history, and this is actually
why the "i" alternative was wanted -- in basically all uses, "i" is
satisfiable, and avoids needing to setup a stack frame and spill a call-saved
register to the stack in order to use it to hold the syscall number to reload
on restart.
More information about the Gcc-bugs
mailing list