[Bug ipa/120987] [13/14/15/16 regression] gdb build with lto triggers use after free since r12-5541-g2cadaa1f134bec

sjames at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 3 19:18:56 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120987

--- Comment #31 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #30)
>    for (n = edge->caller; n->inlined_to; n = n->callers->caller)
> -    flags |= flags_from_decl_or_type (n->decl);
> -  flags |= flags_from_decl_or_type (n->decl);
> +    flags |= flags_from_decl_or_type (n->decl) & flags_mask;
> +  flags |= flags_from_decl_or_type (n->decl) & flags_mask;

It still looks odd because n is left as n->callers->caller, so you get it
applied twice in that case. Can you add a comment?


More information about the Gcc-bugs mailing list