https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113847
--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Richard Biener from comment #5) > CCing also Martin who should know how/why IPA SRA doesn't reconstruct the > component ref chain here I have not had a look at this specific case (yet), but IPA-SRA just doesn't (unlike intraprocedural SRA) and always creates MEM_REFs (in callers). I guess we could stream field offsets and/or array_ref indices and attempt to reconstruct it for simple (non-union, non-otherwise-overlapping) types, even if it would make the ipa_adjusted_param type (and thus ipa_param_adjustments) slightly bigger and add another vector. > or why it choses the dynamic type as it does > (possibly local SRA when fully scalarizing an aggregate copy does the same). That is unlikely. Total scalarization in intraprocedural SRA just follows the type of the decl whereas IPA-SRA (and intra-SRA too when not totally scalarizing) takes all types from existing memory accesses.