https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94146
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(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?)
For big functions the inlining shouldn't happen indeed, possibly by detecting
this kind of forwarders?
So we're missing a testcase showing the regression IMHO. It still works
with -Os for the testcase.