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: Richard Earnshaw <rearnsha at arm dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: Richard dot Earnshaw at arm dot com, aph at redhat dot com, dalej at apple dot com, echristo at redhat dot com, gcc at gcc dot gnu dot org
- Date: Fri, 14 Mar 2003 17:24:42 +0000
- Subject: Re: -fobey-inline (was Re: gcc and inlining)
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> > Of course it's not defined behaviour in C99, since it's unspecified
> > whether inlining will take place for any given function -- and hence
> > anything that depends on inlining occuring is then by definition
> > incorrect. As soon as you make inlining mandatory, these questions start
> > to rear their heads.
>
> Are you sure this is the right exegesis? I would have thought that this was improper
> on entirely different grounds (e.g. that if you remove the inline completely it is
> still improper).
That's not relevant. We know the code is incorrect if you never inline.
The question is whether the code is correct if you always inline.
c99 doesn't have to worry about that situation; since there is no way of
forcing inline behaviour in the standard then the code must be incorrect.
If we want to allow mandatory inlining then we have to decide whether the
example is legal or not. If we decide that it's legal, then we had better
have a test to ensure we do it correctly.
R.