[Bug tree-optimization/121726] [15/16 regression] Possible miscompilation with strict aliasing, uint8_t[] to uint64_t*
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 5 08:27:47 GMT 2026
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 <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:5c46b4d38a8b10c1fe5c0a27472b4e9c7cce2480
commit r16-7305-g5c46b4d38a8b10c1fe5c0a27472b4e9c7cce2480
Author: Richard Biener <rguenther@suse.de>
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.
More information about the Gcc-bugs
mailing list