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

--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Alexander Monakov from comment #1)
> 
> So it wants to pick a scratch register in SIBCALL_REGS ("k", r0-r7), but in
> the circumstances r4-r7 are already used for argument passing, and r0-r3 are
> used for the return value -- and GCC cannot know that the scratch reg
> wouldn't be simultaneously live with those.
> 
> I must say I don't quite see the point of using match_scratch for the callee
> address there.  After all, it's making a sibcall, so GCC can simply pick r0
> or whatever's convenient, no?

I haven't checked the details of this issue, but generally, yes,  It should be
able to pick r0...r3 for the scratch register in this case.  At the time of the
call the values in r0...r3 are undefined and they get defined only after the
call.  Not sure what's the problem here.

> In response to the last sentence in my analysis, on IRC Rich pointed out
> that using r1/r2/r3 should be better that r0 because some instruction can
> operate only on r0 so that would constrain scheduling.

Are there any examples for this statement?

Reply via email to