This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][Middle-end]Add a new option to finer control inlining based on function's visibility
On Wed, 12 Sep 2018, Alexander Monakov wrote:
> On Wed, 12 Sep 2018, Richard Biener wrote:
> > With LTO "static" is too blurry - would -finline-only-hidden be OK
> > with you?
>
> This doesn't sound right - in non-pic, everything is hidden, effectively.
> And the intended use is with Linux kernel, which does not use -fpic.
>
> I agree with LTO this option makes less sense, but I wouldn't expect LTO
> to be used for livepatching-capable kernels.
The issue is that with LTO this option probably cannot be reliably
implemented (well, I guess we could stick 'noinline' attributes
onto all non-static declared functions...).
Btw, what about
inline T foo() {}
in C99? Those are not declared static (in fact there may be
extern T foo () declarations somewhere). I also think we
have to continue to inline always-inline functions.
That is, is it really "-fimplicit-inline-only-static"? Would
it make more sense to have a -fno-implicit-inline switch which
will not inline any function that is not declared inline?
That might be already available via -fno-inline-small-functions
[-fno-inline-functions].
Richard.