This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: AVR function inlining cutoff
- From: "Shaun Jackman" <sjackman at gmail dot com>
- To: "GCC Bugs" <gcc-bugs at gcc dot gnu dot org>, avr-libc-dev at nongnu dot org
- Date: Thu, 22 Nov 2007 13:43:04 -0700
- Subject: Re: AVR function inlining cutoff
- References: <7f45d9390711221228j2673b7d4sc8b3a5a9e4e7a88c@mail.gmail.com>
- Reply-to: "Shaun Jackman" <sjackman at gmail dot com>
Answering my own question:
The `-finline-limit=N' option allows you to adjust the inline
threshold. The documentation says the default is 600. A value of <= 35
ensured that my 116 byte function was not inlined, which suggests that
a more reasonable default value on the AVR might be around 20.
I still want functions that are only called once to always be inlined.
How does the -finline-limit option affect this case?
Cheers,
Shaun
On Nov 22, 2007 1:28 PM, Shaun Jackman <sjackman@gmail.com> wrote:
> With GCC r130284 --target=avr, a 116 byte static function that is
> called twice is inlined even with -Os, effectively doubling the
> function's footprint. I'd argue a function this large shouldn't even
> be inlined with -O2. What is the size cutoff for inlining functions?
> Can I modify it? If a code snippet would help troubleshoot this
> matter, I can certainly send one along.
>
> Cheers,
> Shaun