Re:Betrayed by a bitfield (2012)
by r1ch on Sunday July 03, 2016 @11:52AM
(#12026403)
Curious how this was solved, anyone have a link to a followup?
[ Parent
| on HN ]
Re:Betrayed by a bitfield (2012)
by arcticbull on Sunday July 03, 2016 @03:01PM
(#12027182)
This was resolved in GCC 4.8 here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52080
"Here is a candidate patch (it ICEs one Ada testcase, see PR52134). It enforces the C++11 memory model (as far as bitfields are concerned) upon everyone and builds on the machinery that was implemented for it (changing the implementation for when we compute "an underlying object" and permanently store it, to make it possible to use this information for optimization purposes)."
If I'm not mistaken they could have ensured 64-bit alignment when a bitfield immediately follows a lock, although that likely wouldn't have been fun.