This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix profiledbootstrap ada checking failure (PR debug/79255)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 24 Mar 2017 14:17:15 +0100
- Subject: Re: [PATCH] Fix profiledbootstrap ada checking failure (PR debug/79255)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CFFD92EF189
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CFFD92EF189
- References: <20170323204414.GZ11094@tucnak> <CADzB+2mj8WxSAUvPWcywYt=hEn=0VbAYMSoVH6rxypPV-0kC6A@mail.gmail.com> <20170324074639.GG11094@tucnak> <CADzB+2=1MCK4Vdw-u4Wqt6xx10Rymo3=vJR0Zx+_F3f0P-CR6A@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Mar 24, 2017 at 09:07:54AM -0400, Jason Merrill wrote:
> >> And when it's cloned.
> >>
> >> But does it make sense for gen_decl_die to call
> >> dwarf2out_abstract_function when decl is null? That seems wrong.
> >
> > Before r144529 we had just:
> > if (DECL_ORIGIN (decl) != decl)
> > dwarf2out_abstract_function (DECL_ABSTRACT_ORIGIN (decl));
> > and that is indeed to handle clones etc.
> >
> > r144529 changed that to:
> > if (origin || DECL_ORIGIN (decl) != decl)
> > dwarf2out_abstract_function (DECL_ABSTRACT_ORIGIN (decl));
> > All of the decl is NULL introduced in r144529 implies decl_or_origin
> > is abstract.
> >
> > Removing that origin || wouldn't really work, we'd have to rewrite most of
> > gen_decl_die FUNCTION_DECL handling to use decl_or_origin instead of
> > decl etc.
>
> I was thinking to change it to
>
> if (decl && (origin || DECL_ORIGIN (decl) != decl))
But then you segfault immediately on the next:
else if (cgraph_function_possibly_inlined_p (decl)
&& ! DECL_ABSTRACT_P (decl)
because decl is NULL. So, it would be far easier to do:
if (decl == NULL_TREE)
{
decl = origin;
origin = NULL_TREE;
}
before the
if (origin || DECL_ORIGIN (decl) != decl)
with a comment, rather than to rewrite a couple of dozen decl_or_origin,
and change assumptions that non-NULL origin actually means anything for
FUNCTION_DECL. That is IMO still uglier than the decls_for_scope change
though, but if you prefer that, I can test that.
Jakub