This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inline limits
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>, Hariharan <hariharans at picochip dot com>, rguenther at suse dot de, jh at suse dot cz
- Date: Mon, 9 Feb 2009 09:38:48 -0500 (EST)
- Subject: Re: Inline limits
- References: <497DE4D3.2090104@picochip.com> <84fc9c000901260841q7325db58h49afd6b00489198b@mail.gmail.com> <200902051351.30911.paul@codesourcery.com>
On Thu, 5 Feb 2009, Paul Brook wrote:
> > For -Os it should be enough to set PARAM_STACK_FRAME_GROWTH
> > to zero. Inlining at -Os should already only happen if it decreases
> > (overall!) code-size. Thus, inlining a function that is called once and
> > that does not need to be emitted will always be an overall code-size
> > win.
> >
> > > A side question... Are 'static' single call-site functions always
> > > inlined? I would hope not (under -Os), but just checking.
> >
> > Yes. This is always a code-size win.
>
> Should be, but in practice isn't.
>
> On Thumb-2 we found that the overhead of a function call was often smaller
> than the cost of lengthening branches in the caller.
I'm willing to believe it can also lead to higher register
pressure. (weasel words for "I haven't checked and I can think
of reasons both why it could, and why it should not")
brgds, H-P