This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inlining (was: GCC 3.3 release criteria)
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: Matt Austern <austern at apple dot com>
- Cc: Andi Kleen <ak at suse dot de>,"Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, gcc at gcc dot gnu dot org,Stuart Hastings <stuart at apple dot com>
- Date: 25 Feb 2003 07:45:32 +0100
- Subject: Re: Inlining (was: GCC 3.3 release criteria)
- References: <97FAC2CA-4858-11D7-94CF-00039390D9E0@apple.com>
Op di 25-02-2003, om 01:32 schreef Matt Austern:
> As it happens, Apple may be able to contribute a patch that does what
> you're looking for. We've got a local patch that adds a new command
> line switch, -fobey-inline. The switch does exactly what you think:
> the
> compiler will inline every function that's marked 'inline' whenever it's
> possible. (There are still cases where it's not possible, of course,
> e.g.
> if you mark a recursive function inline.)
>
> We definitely don't want -fobey-inline to be the default: usually it's
> better for the compiler to treat the inline keyword as a hint, and to
> use its own heuristics to decide when to accept the hint. But there are
> cases, as you've found, when a flag like this is useful.
The compiler may be able to make better inlining decisionsm, but it
should IMHO never overrule the user. So if the user says "inline this"
then the compiler should try really hard to do so, even if it thinks the
resulting code is worse than without inlining.
How about making "obey-inline" the default, with a flag to enable a
warning that would make the compiler complain if it thinks the function
shouldn't be inlined?
> If Apple contributed the -fobey-inline patch, would people here be
> interested in it?
Yes.
Greetz
Steven