https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127967
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Martin Jambor <[email protected]>: https://gcc.gnu.org/g:13e56ff4cd7b5e954f6d9af06476715b2bc3d4a4 commit r16-9934-g13e56ff4cd7b5e954f6d9af06476715b2bc3d4a4 Author: Martin Jambor <[email protected]> Date: Mon Oct 26 13:18:24 2026 +0100 ipa-prop: Add missing checks that bit offsets align to byte boundary (PR127967) PR 127967 revealed that there are two places in ipa-prop where it is asked if a load will result in a known constant after IPA-CP but it did not check that the requested offset is at a byte boundary and so could return a constant that sits at a different place within an aggregate (at the byte boundary). This patch simply adds the two checks and a bounds check to ipcp_get_aggregate_const (in the other case that is already performed when obtaining the offset). gcc/ChangeLog: 2026-10-26 Martin Jambor <[email protected]> PR ipa/127967 * ipa-prop.cc (ipcp_modif_dom_walker::before_dom_children): Add a check that bit_offset aligns to byte boundary. (ipcp_get_aggregate_const): Likewise and also add bounds checks. gcc/testsuite/ChangeLog: 2026-10-23 Martin Jambor <[email protected]> PR ipa/127967 * gcc.dg/ipa/pr127967.c: New test. (cherry picked from commit 9d198f575353e706de7fd8049e406ba7630ba33b)
