[Bug c++/71694] store-data race with bitfields and tail-padding in C++

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 29 12:01:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71694

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I guess even if not obviously used as a base we need to consider it being a
base.
Thus for

void foo (B *b)
{
  b->c = 1;
}

we may not access tail padding either.

So stor-layout.c needs to be conservative in finish_bitfield_representative
with including tail-padding which will pessimize code quite a bit unless
the middle-end has a way to identify types that can not possibly have their
tail-padding re-used by inheritance (or other means).  I don't think we have
a way to determine this at the moment.


More information about the Gcc-bugs mailing list