https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78687
--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 6 Dec 2016, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78687 > > --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > From looking at the testcase, I think it is solely SRA that can help here, if > it manages to scalarize everything, we are good, if not, you get terrible > code. > The classes are huge and largely uninitialized, as can be seen on the llvm's > optimized code (first 40 bytes uninitialized, then 12 bytes initialized). I guess the main issue is that SRA is not flow-sensitive so it would need to materialize all aggregate elements as replacement (later DCE would clean up of course). For this case it's easy though -- only parts of the structures are ever written to (the aggregate assignment might confuse SRA enough here though)