From: Martin Sebor <msebor@gmail.com>
To: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] correct uninitialized object offset and size computation [PR101494]
Date: Wed, 28 Jul 2021 16:28:38 -0600 [thread overview]
Message-ID: <14ea6066-7451-9f35-fa00-8305ff94fc8c@gmail.com> (raw)
In-Reply-To: <40bca91d-bf71-74c7-0209-5322c45a5278@gmail.com>
On 7/23/21 10:39 AM, Jeff Law wrote:
>
>
> 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.
Whoops. Fixed and pushed in r12-2583.
Martin
prev parent reply other threads:[~2021-07-28 22:28 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
2021-07-28 22:28 ` Martin Sebor [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=14ea6066-7451-9f35-fa00-8305ff94fc8c@gmail.com \
--to=msebor@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--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).