This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++ inlining (request for better optimization).


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]