From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id E63C63858D32; Fri, 7 Apr 2023 19:29:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E63C63858D32 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=1680895739; i=anlauf@gmx.de; bh=MHWj/+hmUDW8+zINQDlczm05Fpd+W7+dkFa0mMUi8EU=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=Zw42rDJaBs/gRcSjdBA36cxD1G6W3KKRfjoWJqrNMDnf8+U6NE0EIKbdSnPBMSlVl 9McGnOD5aeb2Ei+qW++37MqXfTT3RAdOj6vGRGLaoZCQdXKGyhQdpY2hsf3RB6W4iq US+mEP7GeC4buFdVv8iFY4D2gVbXo2LtI5+P+KhF38xnnVFV3xJm/LQbKjg6I6Xplr rLeLdVppfJ3PZgD0qV2ZMlwGeiI9oDPErl+a6y0g4q81rmUVp8xh3LQ5CHZhC6DBaB RLYw9aa6lCsR9XS3FvD1l5/Tz94AM6cw0jo3w1PtuRED9Q7SXxKfcSZv4atFz5z8BL M9yQbPjBKJDWA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([93.207.89.174]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N7R1T-1qS4qV47fJ-017j8q; Fri, 07 Apr 2023 21:28:59 +0200 Message-ID: <1b87744e-5e9a-f932-21e8-64d122f74a5c@gmx.de> Date: Fri, 7 Apr 2023 21:28:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: Ping! [Patch, fortran] PR87477 - [meta-bug] [F03] issues concerning the ASSOCIATE statement To: Paul Richard Thomas Cc: "fortran@gcc.gnu.org" , gcc-patches Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: <67044cbd-2fa5-8abf-e1d2-42fb150d0124@gmx.de> Content-Language: en-US From: Harald Anlauf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Oe9s+saqjYST/+i/7GeVBA9p6Wths+crE+NCohDqiAoOfmFvjKO SyDLz+Gs85O9gm4ZYsFNwQpHXIgI8eQX+u9RRYj05yFFpRamPPrizSiC5kgzv6bfm7J/41a nrImy0R91DZ6OzNIFcB9HDfvDma6suGbEJ53HHKd30HqH0oiKYiKyjdkUbb83QMjEfyPxIm 3MjJmSkPgjFDsUASZdFlQ== UI-OutboundReport: notjunk:1;M01:P0:hOaZTVc2kTg=;qMnFqpsIG7wfDZjtk717tiz2zfp WOYe8Z9N/WvCXvKEy7w5CxXjci4R0nL9IbA+tmwoh+58+BWG0QQeAgrxunFrwk0v6gwQCDAsU 62GlY8K22RmsoJP3k2hBQkymIv3U4EsGaHKHvEcGjLNcuzPDvws3phladbygr9PhGj23XSs3S /I9ze0Vz7AsEa2y4GV7FmonjKigOwDAlAO01v2FtokuEANLn2TW+dIRsrbZEvbkkoFlSmO+PO 39AinMxyDfbEVjI0+6cDFrlgI+YuSl+ffiKp+3rmyA+bTsrKVtkqeEN3IBX2T+CZmft30NqSC h9q5DuRzEa4spWCAzoYstqLJqUB2STs0Rz1TJt30SG09Zt4XnzGpAXVir6IM9mrstQvK2Fj3H t0E1qRux3Nev/kG6qmKmyzGL4BaJ8mgMO/REkH/n+KLT/7CcNNgCG9qpxG7woAb951wFOle86 bypDDy4vrYZ+taF5nzzBjE7lb72JBV32OAfLkIDcg66pCPXPPSYTG3ivw5mgIt5rv6iXnQT4q PrNHQ+5R6j8X4FWV0l9DvjJVLQynxUswa+6ySFyzQcWRel8ZkfBCKlFoTOizO8yxK5x2hPrBK yBa9yAy9IbB/Q0M1y+uQ736eBeklV/H0no7OF2NJHnjg0FsdLICywF843a3mdtLSNGFhHvlxl qJe3Qmyn6jAR66iqfVgGCbpE115oF84HFvl2+KgxpL6KedO4fTBQ2Korm2nvc8EHrU6GcfLcg fWGn46Bw2iN5yaLEHKB+On2pfmuYJ5hhfzdLGD8Ly9P93V+/9OwDzUcMstku53UoQr/cMjFPU H84zZEczwWFIHahER1wR1PEgsmgVmBLGP49GZTww5zpnGGdMpXD6rkg2ulOUijQluR30IgzY/ eLPfEoG3d3/S3VRIrPQEizEBA4Z+qDrlvplh3pVCB8ZOWDY5wWkdZzuX+xFZ5EdB6VrJjhAEv uSnss42+JAGvfnQKX2vhqw4PU4c= X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,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: Hi Paul, On 4/7/23 15:53, Paul Richard Thomas via Gcc-patches wrote: > duuuh! Please find them attached. the patch LGTM. Thanks! However, I have comments on the new testcase associate_60.f90: subroutine pr93813 is missing an allocation of x, e.g.: allocate (t :: x) otherwise it would be invalid. Please check and fix. Interestingly, subroutine pr92779 exhibits a small memory leak with memory allocated by the spread intrinsic. I played a little and found that the leak depends on the presence of trim(): omitting trim() removes the leak. But looking at the related pr, it seems that trim() was essential, so omitting it is likely not an option. I think the best way is to proceed and to open a PR on the memory leak rather than leaving pr92779 open. What do you think? Cheers, Harald > Thanks > > Paul > > > On Fri, 7 Apr 2023 at 10:41, Harald Anlauf wrote: > >> Hi Paul, >> >> I don't see the new testcases. Is this an issue on my side, >> or did you forget to attach them? >> >> Thanks, >> Harald >> >> On 4/7/23 09:07, Paul Richard Thomas via Gcc-patches wrote: >>> Dear All, >>> >>> Please find attached a slightly updated version of the patch with a >>> consolidated testcase. The three additional testcases are nothing to d= o >>> with associate and test fixes of character related bugs. >>> >>> OK for mainline? >>> >>> Cheers >>> >>> Paul >>> Fortran: Fix some of the bugs in associate [PR87477] >>> >>> 2023-04-07 Paul Thomas >>> >>> gcc/fortran >>> PR fortran/87477 >>> * resolve.cc (resolve_assoc_var): Handle parentheses around the >>> target expression. >>> (resolve_block_construct): Remove unnecessary static decls. >>> * trans-array.cc (gfc_conv_expr_descriptor): Guard string len >>> expression in condition. Improve handling of string length and >>> span, especially for substrings of the descriptor. >>> (duplicate_allocatable): Make element type more explicit with >>> 'eltype'. >>> * trans_decl.cc (gfc_get_symbol_decl): Emit a fatal error with >>> appropriate message instead of ICE if symbol type is unknown. >>> * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in >>> 'previous' and use if end expression in substring reference is >>> null. >>> (gfc_conv_string_length): Use gfc_conv_expr_descriptor if >>> 'expr_flat' is an array. >>> (gfc_trans_alloc_subarray_assign): If this is a deferred string >>> length component, store the string length in the hidden comp. >>> Update the typespec length accordingly. Generate a new type >>> spec for the call to gfc_duplicate-allocatable in this case. >>> * trans-io.cc (gfc_trans_transfer): Scalarize transfer of >>> deferred character array components. >>> >>> >>> gcc/testsuite/ >>> PR fortran/87477 >>> * gfortran.dg/finalize_47.f90 : Enable substring test. >>> * gfortran.dg/finalize_51.f90 : Update an error message. >>> >>> PR fortran/85686 >>> PR fortran/88247 >>> PR fortran/91941 >>> PR fortran/92779 >>> PR fortran/93339 >>> PR fortran/93813 >>> PR fortran/100948 >>> PR fortran/102106 >>> * gfortran.dg/associate_60.f90 : New test >>> >>> PR fortran/98408 >>> * gfortran.dg/pr98408.f90 : New test >>> >>> PR fortran/105205 >>> * gfortran.dg/pr105205.f90 : New test >>> >>> PR fortran/106918 >>> * gfortran.dg/pr106918.f90 : New test >> >> > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id 7BCDC3858421 for ; Fri, 7 Apr 2023 19:29:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BCDC3858421 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pkrlg-0004Yu-2K for gcc-patches@gcc.gnu.org; Fri, 07 Apr 2023 21:29:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: Ping! [Patch, fortran] PR87477 - [meta-bug] [F03] issues concerning the ASSOCIATE statement Date: Fri, 7 Apr 2023 21:28:57 +0200 Message-ID: <1b87744e-5e9a-f932-21e8-64d122f74a5c@gmx.de> References: <67044cbd-2fa5-8abf-e1d2-42fb150d0124@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US In-Reply-To: Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,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: Message-ID: <20230407192857.zjyta4HRAYjznBlGP7kZXj2AIzehUYEpkuN0RNeJzQo@z> Hi Paul, On 4/7/23 15:53, Paul Richard Thomas via Gcc-patches wrote: > duuuh! Please find them attached. the patch LGTM. Thanks! However, I have comments on the new testcase associate_60.f90: subroutine pr93813 is missing an allocation of x, e.g.: allocate (t :: x) otherwise it would be invalid. Please check and fix. Interestingly, subroutine pr92779 exhibits a small memory leak with memory allocated by the spread intrinsic. I played a little and found that the leak depends on the presence of trim(): omitting trim() removes the leak. But looking at the related pr, it seems that trim() was essential, so omitting it is likely not an option. I think the best way is to proceed and to open a PR on the memory leak rather than leaving pr92779 open. What do you think? Cheers, Harald > Thanks > > Paul > > > On Fri, 7 Apr 2023 at 10:41, Harald Anlauf wrote: > >> Hi Paul, >> >> I don't see the new testcases. Is this an issue on my side, >> or did you forget to attach them? >> >> Thanks, >> Harald >> >> On 4/7/23 09:07, Paul Richard Thomas via Gcc-patches wrote: >>> Dear All, >>> >>> Please find attached a slightly updated version of the patch with a >>> consolidated testcase. The three additional testcases are nothing to do >>> with associate and test fixes of character related bugs. >>> >>> OK for mainline? >>> >>> Cheers >>> >>> Paul >>> Fortran: Fix some of the bugs in associate [PR87477] >>> >>> 2023-04-07 Paul Thomas >>> >>> gcc/fortran >>> PR fortran/87477 >>> * resolve.cc (resolve_assoc_var): Handle parentheses around the >>> target expression. >>> (resolve_block_construct): Remove unnecessary static decls. >>> * trans-array.cc (gfc_conv_expr_descriptor): Guard string len >>> expression in condition. Improve handling of string length and >>> span, especially for substrings of the descriptor. >>> (duplicate_allocatable): Make element type more explicit with >>> 'eltype'. >>> * trans_decl.cc (gfc_get_symbol_decl): Emit a fatal error with >>> appropriate message instead of ICE if symbol type is unknown. >>> * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in >>> 'previous' and use if end expression in substring reference is >>> null. >>> (gfc_conv_string_length): Use gfc_conv_expr_descriptor if >>> 'expr_flat' is an array. >>> (gfc_trans_alloc_subarray_assign): If this is a deferred string >>> length component, store the string length in the hidden comp. >>> Update the typespec length accordingly. Generate a new type >>> spec for the call to gfc_duplicate-allocatable in this case. >>> * trans-io.cc (gfc_trans_transfer): Scalarize transfer of >>> deferred character array components. >>> >>> >>> gcc/testsuite/ >>> PR fortran/87477 >>> * gfortran.dg/finalize_47.f90 : Enable substring test. >>> * gfortran.dg/finalize_51.f90 : Update an error message. >>> >>> PR fortran/85686 >>> PR fortran/88247 >>> PR fortran/91941 >>> PR fortran/92779 >>> PR fortran/93339 >>> PR fortran/93813 >>> PR fortran/100948 >>> PR fortran/102106 >>> * gfortran.dg/associate_60.f90 : New test >>> >>> PR fortran/98408 >>> * gfortran.dg/pr98408.f90 : New test >>> >>> PR fortran/105205 >>> * gfortran.dg/pr105205.f90 : New test >>> >>> PR fortran/106918 >>> * gfortran.dg/pr106918.f90 : New test >> >> >