public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] tree-optimization/104475 - improve access diagnostics
Date: Tue, 6 Dec 2022 11:06:46 +0100	[thread overview]
Message-ID: <Y48UNmdzxyeyCEzH@tucnak> (raw)
In-Reply-To: <20221206095020.A865B13326@imap1.suse-dmz.suse.de>

On Tue, Dec 06, 2022 at 10:50:20AM +0100, Richard Biener wrote:
> When we end up isolating a nullptr path it happens we diagnose
> accesses to offsetted nullptr objects.  The current diagnostics
> have no good indication that this happens so the following records
> the fact that our heuristic detected a nullptr based access in
> the access_ref structure and sets up diagnostics to inform
> of that detail.  The diagnostic itself could probably be
> improved here but its API is twisted and the necessary object
> isn't passed around.
> 
> Instead of just
> 
> ...bits/atomic_base.h:655:34: warning: 'unsigned int __atomic_fetch_and_4(volatile void*, unsigned int, int)' writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
> 
> we now add
> 
> In member function 'void QFutureInterfaceBase::setThrottled(bool)':
> cc1plus: note: destination object is likely at address zero
> 
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
> 
> I think it's an improvement - do you agree that it's enough of it?
> 
> Thanks,
> Richard.
> 
> 	PR tree-optimization/104475
> 	* pointer-query.h (access_ref::ref_nullptr_p): New flag.
> 	* pointer-query.cc (access_ref::access_ref): Initialize
> 	ref_nullptr_p.
> 	(compute_objsize_r): Set ref_nullptr_p if we treat it that way.
> 	(access_ref::inform_access): If ref was treated as nullptr
> 	based, indicate that.

LGTM.

	Jakub


      reply	other threads:[~2022-12-06 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06  9:50 Richard Biener
2022-12-06 10:06 ` Jakub Jelinek [this message]

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=Y48UNmdzxyeyCEzH@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).