On inlining in C++

Joe Buck jbuck@synopsys.com
Wed Aug 6 18:06:00 GMT 2003


On Wed, Aug 06, 2003 at 10:30:09AM +0100, Richard Earnshaw wrote:
> > Richard Earnshaw <rearnsha@arm.com> writes:
> > 
> > | > I would point out that the documentation says "as fast as a macro",
> > | > but it should really say "as fast or faster than a macro".
> > | 
> > | Or "better than a macro".
> > 
> > "As fast as a macro" is just fine :-)
> 
> Ah! but it's not, as can be seen from this discussion... :-)

If tree-ssa ever manages to fix the problem I first pointed out on the
gcc2 list in 1994, then we'll actually achieve this goal (of inline
functions being as fast as macros) in almost all cases.

Actually, we have made progress since then: we handle the case of
structs/classes with one element (which occurs for many STL iterators)
well, and we don't get quite as many dead stores in other cases, though
the code still shows artifacts of premature stack slot assignment not
being completely undone, which can kill performance when it happens in an
inner loop.



More information about the Gcc mailing list