https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118924
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #16 from Jan Hubicka <hubicka at gcc dot gnu.org> --- refs_same_for_tbaa_p I think only tests that by alias sets all stores after later that conflicts with earlier will also conflict with later. I do not see how this is useful when access path oracle is used... Since SRA works before LTO streaming we need to be safe to possible alias set/canonical type changes between pre-streaming and post-streamming passes. So I think we are are testing that conflicts with LHS and RHS will end up being same, we need to compare more. Indeed icf solves similar problem and it is done by ao_compare::compare_ao_refs If we don't really have AO refs we may want to refactor the logic. What is done there is 1) comparing ao ref sizes and offsets, that is not needed since we know it match 2) handling accesses with variable offsets, also not needed 3) comparing alignments. Can those get mixed up? I.e. user checking if alignment is large enough and storing conditionally 4) comparing dependence cliques 5) comparing alias sets (after streaming) or types via alias_ptr_types_compatible_p 6) comparing access paths I would say that 3,5 and 6 are needed here, too but possibly also in other uses of refs_same_for_tbaa_p, like tree-ssa-dom? Not sure about dependence cliques - I think we only handle them for function parameters, so perhaps they do not get into anything we can SRA. Not sure about inlined functions though.