This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: how to avoid default inlining of static functions at O3 ?
- From: Brian Dessent <brian at dessent dot net>
- To: fromu2john at yahoo dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 26 Sep 2008 14:03:18 -0700
- Subject: Re: how to avoid default inlining of static functions at O3 ?
- References: <612992.13836.qm@web94913.mail.in2.yahoo.com>
- Reply-to: gcc-help at gcc dot gnu dot org
john wrote:
> I see that at optimization level O3, the compiler is defaultly inlining my static functions. Is there a way to avoid inlining static functions for C programs ?
That's kind of contradictory to what -O3 means, though. -O3 tells gcc
to favor speed at any cost so in effect you are telling it to enable all
the optimizations that it might otherwise consider a poor tradeoff
because they bloat code size with extra inlining. Consider using -Os if
you want less inlining.
Brian