On inlining in C++
Steven Bosscher
s.bosscher@student.tudelft.nl
Tue Aug 5 09:24:00 GMT 2003
Op di 05-08-2003, om 09:39 schreef Richard Sandiford:
> So (IMO) if g++ is going to ignore inline requests for "inlineable"
> functions, the data in favour of that should be overwhelming. It's a
> bit worrying that g++ is already doing this and that no-one seems to
> have a large body of existing data to justify it.
See http://gcc.gnu.org/ml/gcc/2003-07/msg02138.html for a patch that
tells the tree inliner to disregard limits for C++ if the function is
declared `inline'.
This effectively forces `inline' functions to be inlined (unless of
course there are other reasons why inlining is not possible, such as
calls to alloca(), or if the function body isn't available yet).
So far, no-one has actually tried it and produced numbers.
> Even if we change gcc in the way that Gaby suggests, we could still
> provide the existing behaviour as a flag.
Yup, it's easy enough.
Gr.
Steven
More information about the Gcc
mailing list