From: Andi Kleen Date: Thu, 31 Oct 2024 17:26:16 +0000 (-0700) Subject: PR117350: Keep assembler name for abstract decls for autofdo X-Git-Tag: basepoints/gcc-16~3842 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e718a7a789b39ef877e0d66c7a6a85b54eb112f;p=thirdparty%2Fgcc.git PR117350: Keep assembler name for abstract decls for autofdo autofdo looks up inline stacks and tries to match them with the profile data using their symbol name. Make sure all decls that can be in a inline stack have a valid assembler name. This fixes a bootstrap problem with autoprofiledbootstrap and LTO. 2024-10-30 Jason Merrill Andrew Pinski Andi Kleen gcc/ChangeLog: PR bootstrap/117350 * tree.cc (need_assembler_name_p): Keep assembler name for abstract declarations when autofdo is used. --- diff --git a/gcc/tree.cc b/gcc/tree.cc index 125f38b1cfab..833c3a9cc89d 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -798,8 +798,9 @@ need_assembler_name_p (tree decl) || DECL_ASSEMBLER_NAME_SET_P (decl)) return false; - /* Abstract decls do not need an assembler name. */ - if (DECL_ABSTRACT_P (decl)) + /* Abstract decls do not need an assembler name, except they + can be looked up by autofdo. */ + if (DECL_ABSTRACT_P (decl) && !flag_auto_profile) return false; /* For VAR_DECLs, only static, public and external symbols need an