https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121726
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:5c46b4d38a8b10c1fe5c0a27472b4e9c7cce2480 commit r16-7305-g5c46b4d38a8b10c1fe5c0a27472b4e9c7cce2480 Author: Richard Biener <[email protected]> Date: Tue Feb 3 12:18:56 2026 +0100 tree-optimization/121726 - TBAA bug with SRA of address-taken decls The following fixes re-materialization of aggregates before calls that take the address of a scalarized decl. The issue here is that we do not know the appropriate effective type to use for the stores. So we use ref-all accesses for the re-materialization to properly support TBAA info modref might have recorded. The same holds true for the re-load after the call. PR tree-optimization/121726 * tree-sra.cc (build_ref_for_offset): Add force_ref_all parameter and use ptr_type_node as alias pointer type in that case. (build_ref_for_model): Add force_ref_all parameter and pass it through, forcing build_ref_for_offset. (generate_subtree_copies): Likewise. (sra_modify_call_arg): Force ref-all accesses. * gcc.target/i386/pr121726.c: New testcase.
