]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR117350: Keep assembler name for abstract decls for autofdo
authorAndi Kleen <ak@gcc.gnu.org>
Thu, 31 Oct 2024 17:26:16 +0000 (10:26 -0700)
committerAndi Kleen <ak@gcc.gnu.org>
Wed, 27 Nov 2024 03:54:33 +0000 (19:54 -0800)
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  <jason@redhat.com>
    Andrew Pinski  <quic_apinski@quicinc.com>
    Andi Kleen  <ak@gcc.gnu.org>
gcc/ChangeLog:

PR bootstrap/117350
* tree.cc (need_assembler_name_p): Keep assembler name
for abstract declarations when autofdo is used.

gcc/tree.cc

index 125f38b1cfab674af1bc9c7504c03ef2845e9390..833c3a9cc89deda81ac9af4b53c523e72d1a012e 100644 (file)
@@ -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