http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48696
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |x86_64-*-*, i?86-*-* Status|UNCONFIRMED |NEW Known to work| |3.3.3, 4.0.3 Version|unknown |4.5.2 Keywords| |missed-optimization Last reconfirmed| |2011.04.20 09:43:28 Component|other |rtl-optimization CC| |rguenth at gcc dot gnu.org Ever Confirmed|0 |1 Known to fail| |4.0.4, 4.1.2, 4.3.5, 4.5.2, | |4.6.0, 4.7.0 --- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-20 09:43:28 UTC --- First of all, confirmed. We already expand to a byte read-modify-write and later do not realize that with a word one we could combine the later read. Thus, we optimize the bitfield store on its own, not looking at surroundings. I'm not sure where to best address this, rather than throwing in again the idea of lowering bitfield accesses early on trees. Eventually simply always doing whole-bitfield read-modify-write at expansion time will be beneficial, at least when not optimizing for size.