This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Sigh. Inlining heuristics.
- To: Daniel Berlin <dan at cgsoftware dot com>
- Subject: Re: Sigh. Inlining heuristics.
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 09 Jul 2001 23:53:19 -0700
- cc: Linus Torvalds <torvalds at transmeta dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
flag_default_inline == 1 by default (see decl2.c)
That's sort-of epxected in C++. In C++,
struct S { void f() {} };
implicitly declares `f' to be `inline'. In contrast:
struct S { void f(); };
void S::f() {}
does not, but `inline void S::f() {}' is exactly equivalent to the
original version. The standard says that the first and last versions
are semantically identical.
Some people don't like this, which is what `-fno-default-inline' is
for. That keeps the semantics of `inline' (too hairy to talk about
here), but does not actually allow the inlining.
That flag only affects member function, because the standard's
implict-inlineness only applies to members defined in their
containing class definitions.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com