https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486
--- Comment #13 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to rguent...@suse.de from comment #10) > [...] But total scalarization works with the premise > that we don't see any direct accesses to source or destination That is not true, total scalarization just adds special artificial accesses to the aggregate to its data structures and hopes they will blend in nicely with whatever real accesses are already there, so that, for example, val can be propagated in: a.f = val; d = c = b = a; use (d.f); This is a problem because SRA does not like scalar accesses within scalar accesses (I originally wanted to supported it but then backed out almost immediately) so if f did not happen to be exactly the size of the copy step, SRA would give up on the aggregate. This is a limitation which we'd have to lift first, I'm afraid. > so > I think we should simply change "total scalarization" to be > "emit the block-copy on GIMPLE". Preferably without "crossing" > field boundaries but covering padding by choosing larger accesses. Assuming we almost never want to decrease the step size all the way to a char, this will not always help us to deal with the problem with overlapping scalar accesses.