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: dewar at gnat dot com (Robert Dewar)
- To: bernds at redhat dot com, dewar at gnat dot com
- Cc: Richard dot Earnshaw at arm dot com, aph at redhat dot com, austern at apple dot com,echristo at redhat dot com, galibert at pobox dot com, gcc at gcc dot gnu dot org
- Date: Sat, 15 Mar 2003 16:43:24 -0500 (EST)
- Subject: Re: -fobey-inline (was Re: gcc and inlining)
Bernd said
> > Now the compiler should react to this by actually doing the inlining if
> > indeed doing so can reasonbly be expected to improve execution time.
>
> IMO this problem is AI-complete.
You missed the extreme importance of the word "reasonably". Generally
I would say this is like presumption in the law. If a programmer says
inline, the presumption is that inlining makes sense. Only if the
compiler has some very good reason for ignoring it, based on real
knowledge, should it be ignored. Otherwise reasonable behavior is to
believe the programmer. In Ada we find some cases which cause trouble
with inlining, in particular exception handlers can be problematical
in some cases.