This is the mail archive of the gcc-patches@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]

[loewis@informatik.hu-berlin.de: C++, 2.95: vtable thunks patch]


I didn't see this one show up in the archive. I forwarded it for
Martin.

-- 
H.J. Lu (hjl@gnu.org)


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





vthunks.bz2


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