https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65189

            Bug ID: 65189
           Summary: Malformed (C++) class-hierarchy dump on abstract class
                    (in comparission to GCC 4.6.x)
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: meisenmann....@fh-salzburg.ac.at

Following minimal sample (Ie. test.cpp) does generate a noticeable different
class-hierarchy dump with GCC 4.9.2 - compared to GCC 4.6.4:

class A
{
public:
 virtual ~A();
 virtual int getVal() const = 0;
};

Calling
 gcc -c -fdump-classhierarchy test.cpp && type test.cpp.002t.class

a) generates with GCC 4.6.4 (as expected):

Vtable for A
A::_ZTV1A: 5u entries
0   (int (*)(...))0
4   (int (*)(...))(& _ZTI1A)
8   (int (*)(...))A::~A
12  (int (*)(...))A::~A
16  (int (*)(...))__cxa_pure_virtual

Class A .. dropped; Ie. no difference

b) with GCC 4.9.2, the output is

A::_ZTV1A: 5u entries
0   (int (*)(...))0
4   (int (*)(...))(& _ZTI1A)
8   (int (*)(...))0u
12  (int (*)(...))0u
16  (int (*)(...))__cxa_pure_virtual

The two d'tor-entries (offset 8 and 12) are 0u ?!

This issue also affects the generated dump with option
"-fdump-translation-unit"
... which is used by the ABI Compliance Checker (ABICC).
For example, if I compare the ABI-compatibility of abstract classes between
different GCC-versions, a incorrect/false-positive mismatch of the vtable
(concerning the virtual d'tor entries) is determined.

I've already tested some additional options to dtermine a work-around, but
without luck!

Best regards from Salzburg,
Markus

Reply via email to