This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: G++ knowledge of multiple-inheritance class
- To: dje at watson dot ibm dot com (David Edelsohn)
- Subject: Re: G++ knowledge of multiple-inheritance class
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Tue, 6 Oct 98 16:10:15 PDT
- Cc: mrs at wrs dot com, jbuck at synopsys dot com, egcs at cygnus dot com, meissner at cygnus dot com
> Is there any way for a GCC port to know that a function call is to
> a multiple-inheritance class? More specifically, know that a call through
> a virtual function table will be to a thunk (assuming thunks are enabled)
> as opposed to any other indirect call through a pointer? With this
> knowledge, AIX thunk calls could be much more efficient.
Mike Stump answered "not without complex link-time feedback", which
certainly seems to be the right answer. Generally, if you can tell it is
a thunk, you can tell the exact function called and can replace the
indirect call with a direct call that bypasses the virtual function table.
Just the same, multiple inheritance isn't that common in C++ code, so I
don't think it's worth expending a lot of effort making it faster; just
make it correct. The biggest C++ wins are going to come from reducing
the abstraction penalty.