public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Jeff Law <jeffreyalaw@gmail.com>,
	gcc-patches@gcc.gnu.org,  Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] alias: Fix -fcompare-debug issues caused by compare_base_symbol_refs [PR105415]
Date: Fri, 29 Apr 2022 12:58:12 +0200 (CEST)	[thread overview]
Message-ID: <38426n6-341s-9n1-p1p7-r9o03p3847so@fhfr.qr> (raw)
In-Reply-To: <YmvANHX2XbA41VPf@tucnak>

On Fri, 29 Apr 2022, Jakub Jelinek wrote:

> On Fri, Apr 29, 2022 at 11:52:37AM +0200, Richard Biener wrote:
> > On Fri, 29 Apr 2022, Jakub Jelinek wrote:
> > 
> > > On Fri, Apr 29, 2022 at 11:32:15AM +0200, Richard Biener wrote:
> > > > I think that's reasonable (we indeed shouldn't create a varpool node
> > > > here).  I do think that we eventually want to retain removed nodes
> > > > but mark them so.  In fact any debug references will be thrown away
> > > > because of this anyway.
> > > > 
> > > > So I wonder if we can instead simply do if (!x_node) return 0;?
> > > 
> > > I had that in my first version, but after finding out that it triggers
> > > so often for the constant pool decls I thought better to just use
> > > x_decl in that case instead of x_node->decl.
> > > I must say I'm unsure if constant pool decls always stay out of section
> > > anchors or if they can be put there too.
> > > 
> > > > The question is also why sched does any queries for debug-insns,
> > > > does it merely reset them based on the answer?  That said,
> > > > it would be nice to be able to assert that x_node is not NULL
> > > > and catch this in the callers somehow.
> > > 
> > > Unfortunately, several layers of callers don't really know it is for debug
> > > insn.  And the touched code is solely for the section anchors, so e.g. just
> > > checking symtab_node::get (decl) on all mentioned decls when we perhaps can
> > > see if it is debug insn or not would be quite costly and we wouldn't know
> > > if the other reference is anchored.
> > 
> > We might want to reset debug stmts at the time we RTL expand them
> > if referred symbols have no cgraph node?  As said, ->get () instead
> > of ->get_create () is obviously OK but the way we deal with the fallout
> > is a bit suspicious there IMHO.
> 
> So, what about doing that if (!x_node) return 0; in alias.c with the
> exception of DECL_IN_CONSTANT_POOL, plus in cfgexpand.cc throw away
> VAR_DECLs without symtab node?

So we don't have varpool nodes for the constant pool decls?  Are they
CONST_DECLs at least?  I think that's reasonable though ideally we'd
be able to assert that there is a symtab node for the decls ...

> I'll need to do some extra checking on whether we don't really lose any
> useful debug info with the second patch.

At least it was surprisingly simple ;)

Richard.

  reply	other threads:[~2022-04-29 10:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29  9:05 Jakub Jelinek
2022-04-29  9:32 ` Richard Biener
2022-04-29  9:38   ` Jakub Jelinek
2022-04-29  9:52     ` Richard Biener
2022-04-29 10:38       ` Jakub Jelinek
2022-04-29 10:58         ` Richard Biener [this message]
2022-04-29 11:11           ` Jakub Jelinek
2022-04-29 11:22             ` Jakub Jelinek
2022-04-29 11:23               ` Richard Biener
2022-05-02  8:34                 ` Jakub Jelinek
2022-05-02  8:42                   ` Richard Biener
2022-04-29 11:22             ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38426n6-341s-9n1-p1p7-r9o03p3847so@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jakub@redhat.com \
    --cc=jeffreyalaw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).