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

--- Comment #11 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #9)
> (In reply to Iain Sandoe from comment #7)
> > here we fall through to the case were we make a thunk - IFF we were not able
> > to rmove the alias.  However, potentially, we already moved all the callers
> > from the alias to the original.
> > 
> > (a) is that safe?
> 
> Why not?

no idea :-) hence my question.
However, mostly, I wonder what happens when we transfer part of the information
(the callers) but not the remainder (the referrers)?

> > (b) we might as well avoid the work by testing whether the alias will be
> > removable before we set redirect_callers?
> 
> Redirecting the callers is beneficial even when we create trunk.
> For the redirected callers, they will jump directly to the right function,
> while
> without redirection you call a thunk, which in the better case just jumps to
> the right function (ie. sibcall), in the worse case calls it and then
> returns.
> So you save a few instructions on each redirected call.
> When alias is created instead of redirection (in that case we don't redirect
> callers right now), the only advantage of redirection would be tail
> recursion.

Thanks, that clarifies it for me.

Reply via email to