https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121588
--- Comment #21 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Michal Jires <[email protected]>: https://gcc.gnu.org/g:c80b51b93a1abbf9b1e461f21d998ee87fe81927 commit r14-12335-gc80b51b93a1abbf9b1e461f21d998ee87fe81927 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)
