public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: PING [PATCH] correct handling of offsets in PHI expressions [PR103215]
Date: Mon, 29 Nov 2021 09:01:44 -0700	[thread overview]
Message-ID: <3f98da1b-96b7-f2aa-3ecb-be90259414f9@gmail.com> (raw)
In-Reply-To: <0a747b7c-4cff-b643-3b34-5c9e113c7523@redhat.com>

Ping:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585180.html

On 11/22/21 4:54 PM, Martin Sebor wrote:
> In an effort to avoid false positives while still detecting
> certain out-of-bounds accesses the warning code that handles
> PHI nodes chooses the operand with the most space remaining
> as the one representative of the PHI.  That's not right when
> the offsets into the operands are unequal, because it overly
> constrains the range of offsets that can be substracted from
> the pointer.
> 
> The attached change corrects the logic here to not only use
> the size of the largest operand but also to extend the range
> of offsets into it to reflect all operand.  Unfortunately,
> as a result of the more conservative offset computation,
> the fix leads to a fair number of false negatives.  I tried
> to avoid those but couldn't come up with a clean solution
> that didn't require design changes, so I defer those to GCC
> 13.
> 
> The diff is relative to the "cleanup" patch submitted below:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583735.html
> 
> Tested on x86_64-linux and by building Glibc and confirming
> no new warnings.
> 
> Martin


  reply	other threads:[~2021-11-29 16:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 23:54 Martin Sebor
2021-11-29 16:01 ` Martin Sebor [this message]
2021-12-03  3:22 ` 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=3f98da1b-96b7-f2aa-3ecb-be90259414f9@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).