https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80293
--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Richard Biener from comment #2) > We have another bugreport that complains about SRA and Martin said he had > patches but intended to wait for GCC 8. My patch for PR 78687 unfortunately won't help here, that one is aimed at making the original aggregates disappear when in fact we want to leave the intermediate aggregate in a chain of assignments intact, quite the opposite of a normal mode of operation. > Note that I believe that store-merging, SRA (and bswap) are all passes that > should be merged given they perform similar analyses and transforms. Yeah, and I am (slowly) starting to look in that direction. However, with the totally flow-insensitive SRA we have meanwhile, the only remedy for this that I can think of is to throttle down total scalarization here to never produce more than, say, DECL_SIZE (candidate) / BITS_PER_WORD scalar replacements. What do you think?