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: Bernd Schmidt <bernds at redhat dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: geoffk at geoffk dot org, <gcc at gcc dot gnu dot org>, <jbuck at synopsys dot com>
- Date: Sat, 15 Mar 2003 20:52:06 +0000 (GMT)
- Subject: Re: -fobey-inline (was Re: gcc and inlining)
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. Humans are intelligent, something that is
in general not true for computer programs. A source-level decision with the
"inline" keyword can easily be controlled by the user - unless the compiler
decides that it obviously knows more than the programmer. In that case,
you either end up completely lacking the necessary control, or growing warts
like "-fobey-inline" or the "always_inline" attribute.
Bernd