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: Bernd Schmidt <bernds at redhat dot com>
- Cc: Robert Dewar <dewar at gnat dot com>, geoffk at geoffk dot org, gcc at gcc dot gnu dot org, jbuck at synopsys dot com
- Date: Mon, 17 Mar 2003 09:49:57 -0800
- Subject: Re: -fobey-inline (was Re: gcc and inlining)
On Saturday, March 15, 2003, at 12:52 PM, Bernd Schmidt wrote:
On Sat, 15 Mar 2003, Robert Dewar wrote:
And why not? If I add the "inline" keyword, I do it for a good
reason (I
want the function inlined).
even if it makes your program run slower? I think most programmers
would
answer no .. they write inline to speed up their program, not slow it
down
and make it bigger and slower :-)
Well, you'd assume the person who adds "inline" has done measurements
or
looked at the generated assembly.
I wouldn't assume that. I certainly wouldn't assume that most
programmers have done those measurements on every architecture they're
compiling for.
I haven't taken a survey, but my guess is that most programmers who use
'inline' use it to mean something like this: "Here's a small function
that I think should often be inlined, so I'm putting it in the header
file to make it available for inlining in every translation unit where
it's used." It's a mistake to think that the language guarantees
anything more than that, and I don't think most programmers make that
mistake.
--Matt