This is the mail archive of the
mailing list for the GCC project.
Re: On inlining in C++
- From: Joe Buck <jbuck at synopsys dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: aph at redhat dot com, gcc at gcc dot gnu dot org
- Date: Mon, 4 Aug 2003 09:49:46 -0700
- Subject: Re: On inlining in C++
- References: <20030804164452.CF402F2D7E@nile.gnat.com>
On Mon, Aug 04, 2003 at 12:44:52PM -0400, Robert Dewar wrote:
> > Perhaps there is, but the Principle of Least Surprise favours a
> > fairly literal interpretation of "inline".
> I don't agree, a huge blow up in size, resulting in slower execution because
> of icache overload, can also qualify as a surprise.
> Indeed we find that customers are quite often surprised to find that -O3
> is slower than -O2 (as well as generating lots of code).
For most targets, the only difference between -O2 and -O3 is that, with
the latter, we find more functions to inline, beyond those explicitly
marked as inline. I read Gaby's argument as describing the behavior of
-O2, not of -O3 (for which we will still need heuristics to drive inlining