https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87733
--- Comment #29 from Segher Boessenkool <segher at gcc dot gnu.org> --- (In reply to Rich Felker from comment #27) > 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. You need to make $r10 not a clobber but an inout, of course. And not allowing the "i" just costs one more register move, not so bad imo. So you do have a workaround now. Of course we should see if this can actually be fixed instead ;-)