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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
> (In reply to Jakub Jelinek from comment #3)
> > If not already marked clearly as an ICF created thunk, I'd say it should be
> > and then inliner should take it into account (and only inline if the
> > function became very small or not at all).
> 
> It looks like ICF really creates a forwarding call:
> 
> ternary2 (int i)
> {
>   int retval.4;
> 
>   <bb 2> [local count: 1073741824]:
>   retval.4_3 = ternary (i_2(D)); [tail call]
>   return retval.4_3;
> 
> }
> 
> so IMHO for small functions the inlining is good (but why don't we create
> an alias or an alternate entry symbol instead of a full (aligned) function?)

ICF has I think 3 options, one is adjust all callers if they can be adjusted,
another one is to use alias and another one to use a thunk.  Whether to use an
alias or thunk depends on whether something might perform function address
comparisons.

Reply via email to