public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Martin Sebor <msebor@gmail.com>
Cc: Jeff Law <law@redhat.com>,
	JiangNing OS <jiangning@os.amperecomputing.com>,
	       "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR91195: fix -Wmaybe-uninitialized warning for conditional store optimization
Date: Mon, 29 Jul 2019 16:10:00 -0000	[thread overview]
Message-ID: <20190729160348.GD15878@tucnak> (raw)
In-Reply-To: <0f07b57e-9def-2758-c58b-ec9200fa4432@gmail.com>

On Wed, Jul 24, 2019 at 12:07:36PM -0600, Martin Sebor wrote:
> > > There are a number of existing instances of setting TREE_NO_WARNING
> > > to suppress -Wuninitialized, and some are the cause of known problems.
> > > Bugs 51545, 58950, 74762, 74765 or 89697 are examples.  They all boil
> > > down to the fact that there's just one bit for all warnings.  Jakub
> > > mentioned adding a hash-map for this.  That seems like a simple and
> > > good solution.
> > I'm not sure how that really helps here.  We marking the MEM on the LHS
> > and that's not a shared object.  I don't see how it's going to be
> > significantly different using a hash map vs the bit in this circumstance.
> 
> I don't know what Jakub had in mind but the mapping I envision is
> one like hash_map<tree, bitmap> that would make it possible to set
> a bit for each distinct warning for every tree node.  It would let
> us set a bit for -Wuninitialized while leaving the bit for
> -Warray-bounds (and all other warnings) clear.

I had in mind something like a hash_map<tree, const_bitmap> / hash_map<gimple *,
const_bitmap> (or just make it a <void *, const_bitmap>) where possibly the
bitmaps would be shared, so have a hash table in which one would look up existing
bitmaps containing particular sets of warnings and if not create a new one (and
where the bitmaps would be const after creation).
The TREE_NO_WARNING or gimple_no_warning bits would be a flag that one
should look up the hash_map if needed, those bits clear would imply empty
bitmap.  Routines that copy trees or gimple stmts, like copy_node or
gimple_copy would take care of adding the new tree/gimple * into the
hash_map if needed too.
And, because we have a lot of warnings that are only emitted in the FEs, or
say before IPA and not afterwards, we could also have spots where we'd
replace the bitmaps with ones that don't have any of the no longer
interesting warning bits.
Say during gimplification we could drop TREE_NO_WARNING bit or not set
gimple_no_warning if the bitmap only contains FE warning bits, or (perhaps
more questionable whether worth it) replace with a const_bitmap that doesn't
have those).

	Jakub

  parent reply	other threads:[~2019-07-29 16:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  5:52 JiangNing OS
2019-07-23 16:31 ` Martin Sebor
2019-07-24 15:28   ` Jeff Law
2019-07-24 17:00     ` Martin Sebor
2019-07-24 17:23       ` Jeff Law
2019-07-24 18:09         ` Martin Sebor
2019-07-25  6:27           ` JiangNing OS
2019-07-25 19:09             ` Martin Sebor
2019-07-26  5:07           ` Jeff Law
2019-07-29 16:10           ` Jakub Jelinek [this message]
2019-07-30  8:35             ` Richard Biener
2019-07-30  8:36               ` Jakub Jelinek
2019-07-30  8:49                 ` Richard Biener
2019-07-30 14:51                   ` Martin Sebor
2019-08-07 22:17                     ` Jeff Law
2019-09-03 20:22           ` Jeff Law
2019-07-24 16:00 ` Jeff Law
2019-07-29 16:03 ` Jakub Jelinek
2019-09-03 20:27   ` Jeff Law
2019-11-20  0:14     ` Jakub Jelinek
2019-11-20  2:33       ` Jeff Law

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=20190729160348.GD15878@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jiangning@os.amperecomputing.com \
    --cc=law@redhat.com \
    --cc=msebor@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).