https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907
--- Comment #33 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:7d15248d41dc45a4ba2d38ff532b672a5c0651d0 commit r15-4355-g7d15248d41dc45a4ba2d38ff532b672a5c0651d0 Author: Richard Biener <rguent...@suse.de> Date: Sun Oct 13 12:44:04 2024 +0200 tree-optimization/116907 - stale BLOCK reference from DECL_VALUE_EXPR When we remove unused BLOCKs we fail to clean references to them from DECL_VALUE_EXPRs of variables in other BLOCKs which in the PR causes LTO streaming to walk into pointers to GGC freed blocks. There's the question of whether such DECL_VALUE_EXPRs should keep variables and blocks referenced live (it doesn't seem to do that) and whether such DECL_VALUE_EXPRs should have survived in the first place. PR tree-optimization/116907 * tree-ssa-live.cc (clear_unused_block_pointer_in_block): New helper. (clear_unused_block_pointer): Call it.