https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101708
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- void reset2 (struct example * e) { unsigned int _1; <unnamed-unsigned:1> _2; <bb 2> [local count: 1073741824]: _1 = e_4(D)->a; _2 = e_4(D)->c; *e_4(D) = {}; e_4(D)->a = _1; e_4(D)->c = _2; return; So yeah, store-merging could detect that ->a and ->c are preserved, not sure how awkward that would be though. It'll be "splitting" the zero-init {} into pieces based on each "preserve previous value" store. Or sth like that.