[Bug lto/121588] [13/14/15 regression] gcc 15.2.0 crashes when building u-boot 2022.07 with LTO since r15-7754
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 26 14:51:44 GMT 2026
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
<mjires@gcc.gnu.org>:
https://gcc.gnu.org/g:4886dd899bbbcf1da7399e6bdf64cab861f34928
commit r15-10866-g4886dd899bbbcf1da7399e6bdf64cab861f34928
Author: Michal Jires <mjires@suse.cz>
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)
More information about the Gcc-bugs
mailing list