This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ ABI Issues
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 27 Aug 2002 03:17:31 +0100
- Subject: Re: C++ ABI Issues
- References: <27170000.1030400196@warlock.codesourcery.com>
Mark Mitchell wrote:
> G++ incorrectly packs D::i2 into the four bits of tail-padding in
> B.
>
> This is not only an ABI divergence, but also an optimization issue.
> G++ generates a copy-constructor for B that performs the bit-masking
> operations required to copy only the bitfield at the end of B, which
> is more expensive than copying the entire word.
Is there any scenario where the bit-masking is actually necessary?
It seems to me that when B is constructed, it's ok to write to the
padding bits of the destination word. They might get overwritten again
by later constructors in the sequence, but that is ok.
-- Jamie