[Bug c++/13115] [ABI] wrong class hierarchy

nathan at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Nov 26 13:44:00 GMT 2003


------- Additional Comments From nathan at gcc dot gnu dot org  2003-11-26 13:44 -------
Sorry, I should have looked more carefully.

With FSF HEAD using -fabi-version=0 and -fabi-version=2 I get the following
layout for G
Class G
   size=16 align=4
   base size=12 base align=4
G (0x402fe600) 0
    vptridx=0u vptr=((&G::_ZTV1G) + 20u)
  E (0x402fe640) 0 nearly-empty
      primary-for G (0x402fe600)
      subvttidx=4u
    B (0x402fe680) 0 nearly-empty
        primary-for E (0x402fe640)
        subvttidx=8u
      A (0x402fe6c0) 0 empty virtual
          vbaseoffset=-0x00000000c
    C (0x402fe700) 12 empty virtual
        vbaseoffset=-0x000000010
      A (0x402fe740) 16 empty
  F (0x402fe780) 4
      subvttidx=12u vptridx=20u vptr=((&G::_ZTV1G) + 44u)
    D (0x402fe7c0) 4 nearly-empty virtual
        primary-for F (0x402fe780)
        vptridx=24u vbaseoffset=-0x000000014
      A (0x402fe800) 4 empty
    C (0x402fe700) alternative-path
  C (0x402fe700) alternative-path

This is broken. In this hierarchy C's non-virtual base A is placed
at offset 16 - hanging off the end of the struct. See 13114 for why that is.
It is also not at the same offset as C itself, which is incorrect.

I suspect 13114 and 13115 are the same bug

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-26 13:44:50
               date|                            |
   Target Milestone|---                         |3.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13115



More information about the Gcc-bugs mailing list