- To: gcc-patches at gcc dot gnu dot org
- Subject: C++, 2.95: vtable thunks patch
- From: Martin von Loewis <loewis at informatik dot hu-berlin dot de>
- Date: Thu, 3 Feb 2000 22:16:33 +0100
- Cc: hjl at lucon dot org, mgb at yosemite dot net
This is an update of a patch fixing a long-standing bug in g++, which
occurs in certain cases of virtual inheritance; see
http://gcc.gnu.org/ml/gcc-patches/1999-04/msg00103.html
for an earlier version of the same patch.
In addition to my recent changes in this code, HJ Lu also kindly
provided a number of corrections, and also arranged to have this code
used on Linux by default.
In this version, backwards-compatibility to gcc 2.95.2 is provided in
the following way:
- Object creation will always invoke the ctor that does not expect a
vlist argument.
- For every vlist ctor, there is a wrapper ctor that does not expect a
vlist. This wrapper ctor delegates the call, passing 0 as the vlist.
- Each vlist ctor will check whether the symbol representing the base
class ctor is zero (as it is if gcc 2.95 did not emit the base class
ctor). It will then call the base class ctor without vlist,
otherwise it will pass the vlist.
- The dtor does not include the _Vlist argument in its mangled name.
The __in_chrg arg for the dtor has an additional flag 4, which
indicates that the vlist is present. If it is not present, the dtor
will not attempt to access that argument.
The code passes the 2.95 testsuite as good as 2.95.2 does, plus the
additional XPASS for the bug being fixed. There still may be other
issues with this code, so please test the patch on top of the release
branch CVS.
The patch does not apply to the gcc mainline, due to numerous changes
being performed. I'll adopt the patch to the mainline if desired.
Regards,
Martin