https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121588
--- Comment #22 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Michal Jires <[email protected]>: https://gcc.gnu.org/g:441b484726723c15643c7a09af8f2297263f09f8 commit r13-10104-g441b484726723c15643c7a09af8f2297263f09f8 Author: Michal Jires <[email protected]> Date: Fri Dec 19 17:09:16 2025 +0100 lto: Fix SegFault in ICF caused by missing body During LTO symbol merging, weak symbols may be resolved to external definition. We reset the symbol, so the body might be released in unreachability pass. But we didn't mark the symbol with body_removed, so ICF assumed the body was still there causing SegFault. PR lto/121588 gcc/lto/ChangeLog: * lto-symtab.cc (lto_symtab_merge_symbols): Set body_removed for symbols resolved outside of IR. gcc/testsuite/ChangeLog: * gcc.dg/lto/attr-weakref-2_0.c: New test. * gcc.dg/lto/attr-weakref-2_1.c: New test. (cherry picked from commit 8e4107a1b3d430f5d3938c8068c6cd512f661e95)
