This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22488] [4.1 Regression] C++ generates incorrect overlapping fields
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2005 21:13:23 -0000
- Subject: [Bug c++/22488] [4.1 Regression] C++ generates incorrect overlapping fields
- References: <20050714141428.22488.micis@gmx.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mark at codesourcery dot com 2005-09-27 21:13 -------
Subject: Re: [4.1 Regression] C++ generates incorrect overlapping
fields
dberlin at gcc dot gnu dot org wrote:
> ------- Additional Comments From dberlin at gcc dot gnu dot org 2005-09-27 20:42 -------
> We have a var of type C named D.2117
> The first field of this is a field D.2184 of type B
> This field of type B is at offset (offset = 0 + bit_offset = 0) from our var of
> type C
Yes.
> The first field of B is _vptr.B:
>
> It is at offset 0 from our field of type B, which is at offset 0 from our var of
> type C.
Yes; _vptr.B is indeed at offset zero relative to the enclosing C.
> The next field after the type_decl is field_decl 0x40212564 D.1781
Not for me; the next field is:
<field_decl 0x2a95a5e600 x
type <record_type 0x2a95a52210 X type_1 type_5 BLK
When I eventually get to the field of type "A" it says:
<field_decl 0x2a95a2be40 D.1817
type <record_type 0x2a95a22b00 A addressable tree_2
needs-constructing type_1 type_4 type_5 BLK
...
offset <integer_cst 0x2a958e4f60 type <integer_type 0x2a958f6000
unsigned int> constant invariant 16> bit offset <integer_cst
0x2a95901540 0> context <record_type 0x2a95a31580 C>>
Now, I'm looking at the type after layout_class_type. It's possible
that at some later point it gets stomped. Can you take a look to see
what you see after layout_class_type?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22488