https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88709
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Note, especially with large constructors, unlike other overlapping stores it might not be feasible to merge the large clearing or memset with the other stores, but still it might be possible to merge several later stores using info on what we know has been stored in the gaps in between. So, say: struct S { char a[16]; }; void foo (void) { struct S s = {}; s.a[3] = 1; // We don't want to bump this into a larger store unless we can // eliminate the whole 16 byte initialization through it (still, in this case // it is likely beneficial, but we should see what would that = {} be expanded // to, depending on can_store_by_pieces etc. bar (&s); } struct T { char a[1024]; }; void foo (void) { struct T t = {}; t.a[54] = 1; t.a[52] = 2; // But we can using the info that t = {} cleared the whole // var merge these two stores, not using unnecessary masking etc. because // we know what the gaps will contain and can even extend the store // on either side or both to find optimal store size bar (&s); }