This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Inlining (was: GCC 3.3 release criteria)


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]