This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fobey-inline (was Re: gcc and inlining)
- From: Matt Austern <austern at apple dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: galibert at pobox dot com, Richard dot Earnshaw at arm dot com, aph at redhat dot com, echristo at redhat dot com, gcc at gcc dot gnu dot org
- Date: Fri, 14 Mar 2003 10:53:29 -0800
- Subject: Re: -fobey-inline (was Re: gcc and inlining)
On Friday, March 14, 2003, at 10:08 AM, Robert Dewar wrote:
That's not true. Most compilers that I know of use heuristics to
decide
whether or not to do inlining, and will ignore a request to inline an
excessively large function. Some compilers ignore the inline keyword
altogether, and use information gained from interprocedural analysis
do decide whether to do inlining. (Note: I'm not suggesting that gcc
go down that route, at least not yet. That sort of thing only makes
sense for a state of the art optimizing compiler, which gcc isn't.)
It's dubious even for a "state of the art optimizing compiler" The
programmer
often knows better than any compiler what should be inlined.
Sometimes. But this isn't really an argument we need to have, since
the two of us agree that (a) gcc as it stands now shouldn't ignore the
'inline' keyword, and (b) there should be some kind of mechanism for
programmers to force inlining in the unusual circumstances where they
need that kind of low-level control.
--Matt