https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121303
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Philipp Tomsich <ptoms...@gcc.gnu.org>: https://gcc.gnu.org/g:be377ef9ce3eb870ffd18ac02dabe32260dfcb6f commit r16-2759-gbe377ef9ce3eb870ffd18ac02dabe32260dfcb6f Author: Konstantinos Eleftheriou <konstantinos.elefther...@vrull.eu> Date: Wed Jul 30 17:06:33 2025 +0200 asf: Fix null pointer dereference in is_store_forwarding [PR121303] We were calling `is_store_forwarding` with a NULL value for `off_val`, which was causing a null pointer dereference in `is_constant`, leading to an ICE. This patch updates the call to `is_constant` in `is_store_forwarding` and adds a check for `off_val`, in order to update it with the right value. Bootstrapped/regtested on AArch64 and x86_64. PR rtl-optimization/121303 gcc/ChangeLog: * avoid-store-forwarding.cc (is_store_forwarding): Add check for `off_val` in `is_store_forwarding`. gcc/testsuite/ChangeLog: * gcc.target/i386/pr121303.c: New test.