From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dog.elm.relay.mailchannels.net (dog.elm.relay.mailchannels.net [23.83.212.48]) by sourceware.org (Postfix) with ESMTPS id A35F0393BA56 for ; Mon, 5 Dec 2022 16:58:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A35F0393BA56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 913243C0B86; Mon, 5 Dec 2022 16:58:46 +0000 (UTC) Received: from pdx1-sub0-mail-a305.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 235FC3C13B7; Mon, 5 Dec 2022 16:58:46 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1670259526; a=rsa-sha256; cv=none; b=Eipu1igsxUz4E7R0PjbRFAt54y3RbZAXW4B+CPpeQWarlE40/jjPG5ctMYz9WYWzpiu8Ca z/e/2JV+3sUK9ChkKsj737KemchJDoLF6yulNnRmkuBZC/Gy7h2Sc1AAh9JhJTV17GX1h6 TZENU7L5ts0M93P6iodJAfYwQx+gmgzunucw4uj9545SspJ4WF1p1gTuuy+5Yub5P5W8ex r0VZW+gwQTryuQmdYSwruh+X8SzDD5T1MxvJDU/pa9ZSnSKMcPNXvzomfwgCdi25tgEBpj zo+1KzDo/ku126h15opVo5UvPPo/Bzzhq1C1bpLT8DUAx6PXAoTJRrYyenb11w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1670259526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oNqELzDjkF2ew/WRkQXA3k/z04RvkH1MHFAK+ggZICw=; b=Pg2nlQrKy5e/466J/cbmJmKqDfXXkV5Vz/YcuHptmh8V/8zsDpZRDK6vn0+/JeT4QZ884T G22ljmURJGhSusA5u8vhSR2d4RLb009LvXT12bET4rGR8tvILeUOC+YCpH3qCgZSedA7ji E4Qj5UiF2xiWQkVHbORolSiXmmv5l1Cu5rdAbcb3O8epnN/YRSiRUwmcW2+j4aMuKUec6B opOy1MbvLPZiMRNz68kq0a4gf43cUBUS4IQCRmoEZuwTy7scoNFdRSCTvk96HjZWDCeL3O 7qg+tLBaaiqMavtFy2/3PQ2j7mzK+f5QPqb23o22tK9XP305Ot7GMJfwyCITmA== ARC-Authentication-Results: i=1; rspamd-84789cff4b-lr5nh; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Illegal-Celery: 690694aa6b2d66d6_1670259526380_2585103890 X-MC-Loop-Signature: 1670259526380:3216131950 X-MC-Ingress-Time: 1670259526379 Received: from pdx1-sub0-mail-a305.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.123.200.112 (trex/6.7.1); Mon, 05 Dec 2022 16:58:46 +0000 Received: from [192.168.0.182] (bras-base-toroon4834w-grc-23-76-68-24-147.dsl.bell.ca [76.68.24.147]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a305.dreamhost.com (Postfix) with ESMTPSA id 4NQqWT1XKZz4h; Mon, 5 Dec 2022 08:58:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1670259525; bh=oNqELzDjkF2ew/WRkQXA3k/z04RvkH1MHFAK+ggZICw=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=r7eOx9bZYhnj8M1Um7zluviob77l/wADZiffMPAqm1AbOA69YUdBTeM1DrnDsJLIM zGdE9Ecnav1HhGYLNFdPQ3vvNcW/yBEaV4J1g3Goxjfxv1NYEXA0P4iX3dbpW1gh1W vdnJzRwQupZAdScTFyqSSj/WmyuKkn57JOT74uqdgrNzFhKaZCAZ1xZ3PO5wvtGyRo uaPhZDrVACpT603JF28hl6d8ALcppPg5j3VNW/S2octcpXg3yreSXm1Nx29UKctwSz Xyu8Y83OLLAYO9owlY2fWiuun49NPdiospjEUk50Ilj8AtVkMpU19FsC69AnbxoeA2 nKX676VmghXQg== Message-ID: <64a6ecc9-9637-9ab9-e839-23ef67b6ebaf@gotplt.org> Date: Mon, 5 Dec 2022 11:58:43 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] testsuite: Fix leaks in tree-dynamic-object-size-0.c Content-Language: en-US To: Jeff Law , gcc-patches@gcc.gnu.org References: <20221205142850.969850-1-siddhesh@gotplt.org> <4f79f550-e1ba-1974-32ae-5a2d6e0b52f9@gmail.com> From: Siddhesh Poyarekar In-Reply-To: <4f79f550-e1ba-1974-32ae-5a2d6e0b52f9@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3029.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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