https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121588
--- Comment #20 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Michal Jires <[email protected]>: https://gcc.gnu.org/g:4886dd899bbbcf1da7399e6bdf64cab861f34928 commit r15-10866-g4886dd899bbbcf1da7399e6bdf64cab861f34928 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)
