https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127104
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Josef Melcr <[email protected]>: https://gcc.gnu.org/g:bfedd20faaab8ee827db47c1b2e3f879fd8ba808 commit r17-4515-gbfedd20faaab8ee827db47c1b2e3f879fd8ba808 Author: Josef Melcr <[email protected]> Date: Thu Sep 10 15:49:31 2026 +0200 Downgrade IFN_ASSUME from const to pure This patch changes IFN_ASSUME to be pure instead of const. The const attribute means (not only) that the function cannot read global memory. While this is true for the internal call itself, it is only a dispatcher for the outlined assume body, which may read any memory, e.g. below: ``` struct S { int x, y; }; bool bar (int, int); bool foo (struct S *s) { [[assume (bar (s->x, s->y))]]; return s->x; } ``` Now, the read does not actually happen in reality, as the assume's body does not make into the final binary, but the call being marked incorrectly as const makes our analysis less accurate. PR ipa/127104 gcc/ChangeLog: * internal-fn.def (ASSUME): Downgrade from const to pure. Signed-off-by: Josef Melcr <[email protected]>
