On Tue, Nov 5, 2024 at 2:02 AM Jason Merrill <ja...@redhat.com> wrote: > > On 10/31/24 4:40 PM, Andi Kleen wrote: > > From: Andi Kleen <a...@gcc.gnu.org> > > > > 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. > > OK in a week if no other comments.
Hmm, but DECL_ABSTRACT_P should be only set on entities that generate no code. How does autofdo look them up? Are you sure it's the abstract decl autofdo wants to lookup? Or is autofdo processing not serializing the compilation and thus it affects code generation on parts that have not been processed yet? That said, the patch doesn't make much sense to me. Richard. > > 2024-10-30 Jason Merrill <ja...@redhat.com> > > Andrew Pinski <quic_apin...@quicinc.com> > > Andi Kleen <a...@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 | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/gcc/tree.cc b/gcc/tree.cc > > index b4c059d3b0db..92f99eaccd72 100644 > > --- a/gcc/tree.cc > > +++ b/gcc/tree.cc > > @@ -787,8 +787,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 >