From: Jeff Law <jeffreyalaw@gmail.com>
To: Martin Sebor <msebor@gmail.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] correct uninitialized object offset and size computation [PR101494]
Date: Fri, 23 Jul 2021 10:39:13 -0600 [thread overview]
Message-ID: <40bca91d-bf71-74c7-0209-5322c45a5278@gmail.com> (raw)
In-Reply-To: <596aa986-8619-ae8e-8fe8-7c3bfc6e08ec@gmail.com>
On 7/22/2021 3:58 PM, Martin Sebor via Gcc-patches wrote:
> The code that computes the size of an access to an object in
> -Wuninitialized is limited to declared objects and so doesn't
> apply to allocated objects, and doesn't correctly account for
> an offset into the object and the access size. This causes
> false positives.
>
> The attached fix tested on x86_64-linux corrects this.
>
> Martin
>
> gcc-101494.diff
>
> Correct uninitialized object offset and size computation [PR101494].
>
> Resolves:
> PR middle-end/101494 - -uninitialized false alarm with memrchr of size 0
>
> gcc/ChangeLog:
>
> PR middle-end/101494
> * tree-ssa-uninit.c (builtin_call_nomodifying_p):
> (check_defs):
> (maybe_warn_operand):
>
> gcc/testsuite/ChangeLog:
>
> PR middle-end/101494
> * gcc.dg/uninit-38.c:
> * gcc.dg/uninit-41.c: New test.
> * gcc.dg/uninit-pr101494.c: New test.
OK once you complete the ChangeLog entry for the tree-ssa-uninit.c
change. Note this change only modifies maybe_warn_operand.
jeff
next prev parent reply other threads:[~2021-07-23 16:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-22 21:58 Martin Sebor
2021-07-23 16:39 ` Jeff Law [this message]
2021-07-28 22:28 ` Martin Sebor
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=40bca91d-bf71-74c7-0209-5322c45a5278@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--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).