This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6831: Wrong base class alignment (nvalign vs. align)
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Grigory_Zagorodnev at vniief dot ims dot intel dot com, gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nathan at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Date: Fri, 05 Jul 2002 13:08:23 +0100
- Subject: Re: c++/6831: Wrong base class alignment (nvalign vs. align)
- Organization: Codesourcery LLC
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6831
I do not get the different layout that you describe. I do get a different
layout to the one you think you should get. The layout I get
accords to the ABI. Here is the -fdump-class-hierarchy output for E. I have
marked the important offsets.
this is with a cross compiler configured as --target=ia64-intel-unix
Class E
size=48 align=16
E (0x40090a40) 0 <- offsetof (E)
vptridx=0 vptr=((&E::_ZTV1E) + 32)
B (0x40090a80) 0 nearly-empty <- offset of (B)
primary-for E (0x40090a40)
subvttidx=8
A (0x40090ac0) 24 virtual canonical <- offset of A
vbaseoffset=-24
D (0x40090b00) 8 <- offset of D
subvttidx=16 vptridx=24 vptr=((&E::_ZTV1E) + 56)
C (0x40090b40) 32 virtual canonical <- offset of C
vbaseoffset=-32
Note D has a dsize of 12, and 4 bytes of tail padding. Because D is a
non-pod, we can overlay that tail padding with another object. Here
is the layout we should and do get for ia64
off size name
0 8 E::B::vptr
8 8 E::D::vptr
16 4 E::D::d
20 4 E::e overlayed ontop of D's tail padding
24 4 E::A
28 4 alignment padding
32 16 E::C
48
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org