https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114624
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:97d5cd8740384dbce5a83080916388f80d8976dd commit r14-9829-g97d5cd8740384dbce5a83080916388f80d8976dd Author: Richard Biener <rguent...@suse.de> Date: Mon Apr 8 10:38:49 2024 +0200 tree-optimization/114624 - fix use-after-free in SCCP We're inspecting the replaced PHI node after releasing it. PR tree-optimization/114624 * tree-scalar-evolution.cc (final_value_replacement_loop): Get at the PHI arg location before releasing the PHI node. * gcc.dg/torture/pr114624.c: New testcase.