From: Jeff Law <jeffreyalaw@gmail.com>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>,
Matthias Klose <doko@ubuntu.com>,
David Malcolm <dmalcolm@redhat.com>,
gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] analyzer: Recognize __builtin_free as a matching deallocator
Date: Wed, 25 Aug 2021 17:08:36 -0600 [thread overview]
Message-ID: <af415689-6710-6698-4560-65eb22cdcb16@gmail.com> (raw)
In-Reply-To: <4604bd1a-8e4f-7fb3-03d4-6c9e0624c5a2@gotplt.org>
On 8/25/2021 9:16 AM, Siddhesh Poyarekar wrote:
> On 8/25/21 5:44 PM, Matthias Klose wrote:
>> On 7/28/21 1:44 PM, David Malcolm via Gcc-patches wrote:
>>> On Wed, 2021-07-28 at 10:34 +0530, Siddhesh Poyarekar wrote:
>>>> Recognize __builtin_free as being equivalent to free when passed into
>>>> __attribute__((malloc ())), similar to how it is treated when it is
>>>> encountered as a call. This fixes spurious warnings in glibc where
>>>> xmalloc family of allocators as well as reallocarray, memalign,
>>>> etc. are declared to have __builtin_free as the free function.
>>>>
>>>> gcc/analyzer/ChangeLog:
>>>> * sm-malloc.cc
>>>> (malloc_state_machine::get_or_create_deallocator): Recognize
>>>> __builtin_free.
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>> * gcc.dg/analyzer/attr-malloc-1.c (compatible_alloc,
>>>> compatible_alloc2): New extern allocator declarations.
>>>> (test_9, test_10): New tests.
>>>
>>> Looks good to me, thanks
>>> Dave
>>>
>>>
>>
>>
>> Please could this be backported to all active branches?
>>
>
> Sure, it looks like only gcc11 needs this since malloc attribute
> matching seems recent. David, I've never done a backport before, may
> I just cherry-pick, push and post a [committed] patch on list or does
> it need to go through review?
In general it's fine to cherry-pick fixes from the mainline to a release
branch that fix regressions, incorrect code and the like.
This doesn't fall into one of those categories -- but given this is
limited to the analyzer, I think it's fine to cherry-pick into the
release branch as long as David is OK with it as well.
jeff
prev parent reply other threads:[~2021-08-25 23:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-28 5:04 Siddhesh Poyarekar
2021-07-28 11:44 ` David Malcolm
2021-08-25 12:14 ` Matthias Klose
2021-08-25 15:16 ` Siddhesh Poyarekar
2021-08-25 23:08 ` Jeff Law [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=af415689-6710-6698-4560-65eb22cdcb16@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=dmalcolm@redhat.com \
--cc=doko@ubuntu.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=siddhesh@gotplt.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).