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)
On Saturday 15 March 2003 00:50, Geoff Keating wrote:
> Joe Buck <jbuck at synopsys dot com> writes:
> > dewar at gnat dot com (Robert Dewar) writes:
> > > |> It's dubious even for a "state of the art optimizing compiler" The
> > > |> programmer often knows better than any compiler what should be
> > > |> inlined.
> >
> > On Fri, Mar 14, 2003 at 09:00:39PM +0100, Andreas Schwab wrote:
> > > The same has been said about register ....
> >
> > There are important differences.
> >
> > In the case of the kernel programmers, they most emphatically *do* know
> > that a function marked inline must be inline, because there are points in
> > the kernel where there is not even a stack. In such cases, the decision
> > about whether to do inlining simply cannot be left to the compiler.
>
> This is true for some functions marked inline in the kernel, but not
> for all of them; some are marked inline just for speed. That's why a
> global flag like -fobey-inline is a bad idea, and the attribute that
> we have now is a good idea.
>
No, if the function is marked inline incorrectly the programmer should
discover it and remove the it himself. C is not a language there the
semantics mean: "I have no idea what I am doing, so please to whatever you
want with what I write".
`Allan