http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59734
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-01-09 CC| |jason at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Hmm, the C++ memory model only disallows this because the padding might be re-used in a derived class like struct foo : str { short x; }; but at least 'str' has to be non-POD for this to happen it seems. That is, for struct str { str() {} volatile unsigned f1: 8; }; struct foo : str { short x; }; sizeof (foo) == sizeof (str) == 4 and thus accessing f1 with SImode would introduce a data race with 'x' which is not allowed. If the FE would provide a way to tell whether tail padding might be possibly re-used we can avoid this for the simple case. Jason? That is, add langhook that tells us this (or a flag on the types).