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: jakub at redhat dot com
- Subject: Re: -Os & inlining functions used only once
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 17 Apr 2001 11:48:54 -0700 (PDT)
- Cc: neil at daikokuya dot demon dot co dot uk (Neil Booth), aduret at enst dot fr (Alexandre Duret-Lutz), gcc at gcc dot gnu dot org
> Perhaps it could make sense to add a warning (not enabled through either -W
> or -Wall) which would warn if a static function used only once was not
> marked inline.
Or the user can compile twice, and the first compile writes a side file
that is read the second time. That approach can be extended to allow
for optimizations across compilation units (the canonical C++ example
is to notice which virtual functions are never overriden by derived
classes, permitting direct calls or inlined calls rather than calls
through the vtable).