From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by sourceware.org (Postfix) with ESMTPS id 56618385841A; Sat, 25 Feb 2023 17:20:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56618385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1677345642; i=anlauf@gmx.de; bh=U1MTiLzx8esxJHSpBlq1kt5zdusCtvi280ZzCMIPPfM=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=YxImOfw1Q5446YFa9RZu5xfWlSOEmLgCHaBDOjdI4BHUs7/gahY0zI6rkuGtrrWjy DFLp9eYTBfom6DvMveuxsC1cEEgPg5KMPxUh1ydDh8XJvxWrhwrLxvSm1dSSn/e/9B hh4aSWnebTni/Vmzi0ih/T7qSitxr+3UHWhYaXDxPDJpWG8b1BCyVLfBkgrxgJh5MD pBdWns199GAUD1E5Fv2vabazSNEZAt9V0RN+EN0hve4iUkcFehaBvyalK8GALsHZ6X 9T5/FMYchCmBwYafGcxkngmUb6DlO0b53oMAuVFPaT4tbxsNHR70Bah3eJhce6Nv2p T0YHj3Xd+R0tA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([79.232.147.80]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MV67y-1p65bY1xpe-00S4re; Sat, 25 Feb 2023 18:20:42 +0100 Message-ID: <3a6bd277-f8e7-aca7-9077-7f86834b7b5f@gmx.de> Date: Sat, 25 Feb 2023 18:20:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: fortran: Reuse associated_dummy memory if previously allocated [PR108923] To: Mikael Morin , gfortran , gcc-patches Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: <48878e99-0ecb-3688-0c2e-db7ec69856df@orange.fr> Content-Language: en-US From: Harald Anlauf In-Reply-To: <48878e99-0ecb-3688-0c2e-db7ec69856df@orange.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:l1cOJ3pg8Oy4c5yJIdtXIibOYCnkp3qcJZBvkRGozlRDioWh9Sp cGhvjxKZtWGpOkJ052h/u9GNgbx85t7VkTC8rLyZkmH1mwSmH6zoRfEVmaJo1P5M2VEm4Ay 10mHcJx4tQcdqT2+h2lBiZ6Nb11JO84wxYiff5MDdhKuv8NYEVHYzukquWZfiDUT1/GZJPI pLXgbWfRa3WLwbsZ/BCFw== UI-OutboundReport: notjunk:1;M01:P0:+O5lYAXI/tY=;8EZh7AF5M4/nzBamh39aQMJ2Vkz ulWwD6+a7Q+jhNGRI3QLqPk/OT1vrolaom7A2F40Z6gKYOleuu1iQPThfqZpvjFahsqb/Cjvy KlpBP0+BXH2kYzuZq+6GrVqYGiyZULlPImamw2/3HeX6LugOzE4PfZSaiZS5wGXs56FP64y5j rrNcmxhFRamjK4DshVZDDpQgRt7D+on/n/p/b960vSaDs/x66/FBFX+Vc8V+Ph0q1wUrOcTZi qB85OzRcYUfw5XWiI9IBv+iu3AWezplldhpVXRqgmkTi2NRHlUYJUf2jlB9t8dLBzgiOUq2xP shQ+KyrCyZ5B4yThAgeAD376TJfitHiXC3ECRDbQRGleg1gu5b0x4Z+0NtvYv3KLhimyoJDWt p9EzvgFI1ZTrAWePzJ2FM7CL7e7HuMAZKuI4x5UKppJ/9CVQgN1CHg1Ak+ZjxZPlM0UlxgkMt W47DKSJpZd5Nzvv5KakkzlbQ85Oa3Thcg01NtOx8DBsz3x2XiUeuVavY2MQaoSFtzDsjAXtQh K2gvu5u505YLpsZqZauo4KSyVe7LTvsB13LlmuJT1b9/RD6b+Icu/qEK11ljDZFLUxvX7jIwh Tyyj1HpdEgMyxLQuYzfLoilDHiOr3wkJqSnlRpmN1vffBmMm5vOHigEEcLYkptGU+nB8a9+QV gQBdrwBF2z0JrENNMJKHYBMjlDhj2+PZoEzDwbKK8rTaju9PavWZ88Nst3YcjDKdVDVOdQ8TO iHXD/7+zs2Jg9pmcak76HpMTHItvtxNo62ya8Hbllsbjrpz63q+6m7qQDyz92juMI1tkGhVjP rLt2rvG36XsVWGIzxewFFWTQ6S3YRWK6x5UXK+IfQ6a1XOnE0R1PxEB2btKBElhOB2isfO124 HgYkmkcwq/IEEVKGe7HDS+BWSg6LyDYQXtW2bB0cOCGWjhLDsqWkxqzFDhqgdy+sYwuj32sha +C01AnF1Z3/oFCqzo8NjssXBGfM= X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Mikael, Am 25.02.23 um 17:35 schrieb Mikael Morin: > Hello, > > Harald found a testcase with memory still leaking despite my previous > patch for PR108923. > That patch was fixing a leak caused by absence of memory release, the > attached patch fixes a leak caused by pointer overwrite. > > I haven't investigated why sort_actual is called several times( which > causes the memory leak) nor tried to avoid that.=C2=A0 Theoretically, on= e > could assert that the previous associated_dummy value is the same as the > one to be written (it should be the same at each sort_actual > invocation), but I have preferred to silently overwrite, and fix just > the memory problem. > > Manually tested on Harald's testcase (predcom-1.f) and ran the full > fortran testsuite on x86_64-pc-linux-gnu. > > OK for master and 12 and 11? LGTM. OK for master and 12-branch. It appears that 11-branch is significantly different in the respective places. get_intrinsic_dummy_arg does not exist there, so this patch seems to not apply there. Or am I missing something? Thanks for the patch! Harald