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: -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


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