From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 5D78C3858434; Thu, 21 Oct 2021 02:59:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D78C3858434 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: O8VAk5HXiLt2cgxuHhWP7D1hpWy+GxV2o1Wb42romHPMduoxKy4fpuUfr79R3cI+ON8ts1Uzb0 XzGDSVQ8alyzLk5R+njK8SY2PXYXD2DpGPfIvs0zCcMHNWrL5Fg0IqiOJvLxSYXjTwoUP0/fgG VzGsZ9PtJP2VrNXjZPEUHwGbYAFMjt9skpEZmXjGQLUSzUewPHrlTDij8U135pCGYBBIRo6Ixz eqSYbQvkfaU6w83fELp2QslltMZ9X8wRyuExmXagWvxIbkcCplZGPz9mmbQCY3+u1dXtswP7Yo HOs97EygWZmvMGPOG4mt9Sez X-IronPort-AV: E=Sophos;i="5.87,168,1631606400"; d="scan'208";a="69916655" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 20 Oct 2021 18:59:26 -0800 IronPort-SDR: hsyu3JdAkNVfXfXXmeaNXhLTCKDGErE5/RmpRNguv7YZAwqgoCdVYB6131Ba1j+Um7m9BdgpuT h89EXV9KFWU8bGJ575XQv2f8IOvzW3Kg36MpLQ0pvYLj4YmD2LBH14VsepfLU99nRLwaIRexJZ aQ8hnhYl3G7yE+s+f9Vq0HeV+lUc/cRKbFLOU6x1pEOpMNn6AiMciFPElBNJaJef9tr/IJx9hZ JBdQQr0tq5Jb5jXZ59iAgVT/QlXtKoUTvpGXmsG86+FVNt/uk2xx9pRCFsUn0pVVE9HX0Rg7eH SbQ= Subject: Re: [PATCH] Fortran: Fixes and additional tests for shape/ubound/size [PR94070] To: Tobias Burnus , "fortran@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" References: From: Sandra Loosemore Message-ID: <4ba1b6a3-21cd-6a27-5e6c-94c983ef19b0@codesourcery.com> Date: Wed, 20 Oct 2021 20:59:20 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SVR-ORW-MBX-09.mgc.mentorg.com (147.34.90.209) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2021 02:59:27 -0000 On 10/20/21 3:41 PM, Tobias Burnus wrote: > Hi Sandra, > > On 20.10.21 22:03, Sandra Loosemore wrote: >> The one that was most concerning was an ICE when calling the SHAPE >> intrinsic with an assumed-rank class type argument ... In this case, >> SHAPE was calling a library function and trying to copy the array >> contents to a temporary, which is really stupid because SHAPE only >> needs to look at the descriptor and not the array contents.  I thought >> we could handle this inline the same as UBOUND and LBOUND, by >> extending gfc_trans_intrinsic_bound, and avoid the library function >> entirely. >> >> Then, I found some other existing problems in >> gfc_trans_intrinsic_bound; the conditional it was building to test for >> the extent-zero special cases for LBOUND and UBOUND was completely >> wrong, and the compile-time test for the assumed-rank/assumed-size >> case was wrong too.  So I ended up rewriting large parts of that >> function. >> >> I also fixed a bug in the SIZE intrinsic where it was not taking the >> class types into account.  (SIZE is already being handled inline in a >> separate place, otherwise I might've merged it into >> gfc_trans_intrinsic_bound as well.) > > Thanks for your efforts! > > LGTM with the changelog path fix, without the gfc_tree_array_size > attribute change and with the indentation fix. Thanks, committed now with those fixes. You are right that I'd made that change to gfc_tree_array_size before I pulled your alternate fix for that, and didn't realize that my hack had become redundant. -Sandra