This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Os & inlining functions used only once
- To: dkorn at pixelpower dot com (David Korn)
- Subject: Re: -Os & inlining functions used only once
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 17 Apr 2001 11:52:00 -0700 (PDT)
- Cc: aduret at enst dot fr, gcc at gcc dot gnu dot org
> >> -finline-functions seems a good candidate but it doesn't appear
> >> to works with -Os:
> >
> >If -Os is active and you also request inlining, the only functions that
> >get inlined are those that are so small that the inlined code is about the
> >same size as the code to pass the arguments and call the function (meaning
> >that we save space no matter how many copies we inline).
David Korn writes:
> That is precisely the case here, since the inlined code amounts to
> replacing "call _foo" with "movl $1,%eax". If you replace -Os with -O,
> you get the expected results:
[ example deleted ]
Odd. I've gotten inlining of small functions with -Os in the past.
On the other hand, that's for C++, for functions defined in the class
header and thus implicitly marked inline already. I've never tested C.