public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] testsuite: Fix leaks in tree-dynamic-object-size-0.c
Date: Mon, 5 Dec 2022 11:58:43 -0500	[thread overview]
Message-ID: <64a6ecc9-9637-9ab9-e839-23ef67b6ebaf@gotplt.org> (raw)
In-Reply-To: <4f79f550-e1ba-1974-32ae-5a2d6e0b52f9@gmail.com>

On 2022-12-05 11:38, Jeff Law wrote:
> 
> 
> On 12/5/22 07:28, Siddhesh Poyarekar wrote:
>> In commit e5cfb9cac1d7aba9a8ea73bfe7922cfaff9d61f3 I introduced tests
>> for strdup and strndup with leaks.  Fix those leaks.
>>
>> gcc/testsuite/ChangeLog:
>>
>>     * gcc.dg/builtin-dynamic-object-size-0.c (test_strdup,
>>     test_strndup, test_strdup_min, test_strndup_min): Free RES
>>     before returning from function.
> We don't generally worry about these kinds of issues in the testsuite. 
> My only worry would be compromising the test.  By adding the free calls 
> the compiler might match up the allocation and release and potentially 
> turn it into an alloca.  I don't think we're likely to do that in this 
> case, but it's worth keeping in mind.

Ack, thanks, I'll keep that in mind.

> So OK as long as you've verified the test still does what it's supposed 
> to do.

I have verified that the test still works correctly and the optimizer 
hasn't done anything funny with the calls, i.e. the str*dup calls and 
free calls are as is.

Thanks,
Sid

      reply	other threads:[~2022-12-05 16:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 14:28 Siddhesh Poyarekar
2022-12-05 16:38 ` Jeff Law
2022-12-05 16:58   ` Siddhesh Poyarekar [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=64a6ecc9-9637-9ab9-e839-23ef67b6ebaf@gotplt.org \
    --to=siddhesh@gotplt.org \
    --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).