This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ inlining (request for better optimization).
- To: osv at Javad dot RU (Sergei Organov), egcs at cygnus dot com
- Subject: Re: C++ inlining (request for better optimization).
- From: Jason Merrill <jason at cygnus dot com>
- Date: 28 Nov 1997 15:38:15 -0800
- References: <347D98EB.6187E5EA@javad.ru><347EB778.61ECD34D.cygnus.egcs@javad.ru>
The reason it doesn't work like you want it to work is that inlining is
done at function definition time. If f() uses g(), g() must be defined
before f() is defined if it is to be inlined, so that its RTL can be
inserted into the RTL for f. It sounds like you expect inlining to be done
on a level closer to the source code, so that when someone inlines f() they
encounter the call to g() and go inline that, but it doesn't work that way
in gcc. RTL is too low-level for that.
It would certainly be possible to do things the way you would like, but it
would probably involve throwing away the current inlining code and starting
over, and is therefore unlikely to happen any time soon.
Jason