This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ ABI Issues


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]