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 38B413858D39; Tue, 28 Sep 2021 19:15:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 38B413858D39 X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [79.251.12.12] ([79.251.12.12]) by web-mail.gmx.net (3c-app-gmx-bs02.server.lan [172.19.170.51]) (via HTTP); Tue, 28 Sep 2021 21:15:38 +0200 MIME-Version: 1.0 Message-ID: From: Harald Anlauf To: Tobias Burnus Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: Re: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070] Content-Type: text/plain; charset=UTF-8 Date: Tue, 28 Sep 2021 21:15:38 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <8e95ecf2-768c-b80e-ff62-5a94f6ed52fe@codesourcery.com> References: <53d84639-36ea-15e0-fecc-359007294dc0@codesourcery.com> <6413a5ba-4b64-1e47-1800-d4fd7402c16e@netcologne.de> <89e972fd-fd0c-4269-4598-b025faa7e0ca@codesourcery.com> <8e95ecf2-768c-b80e-ff62-5a94f6ed52fe@codesourcery.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:xS2qtF1ZZzo060iVuFdY/h7j3CaWQ1iwtvV4DmrlQ65wcNNFFRBOoeZQV3PMDhkjk4d1P ALzNy+0R1ibHvekDe78TICeueROeHdp/NAy7V5BLJKw19ACyXdHeuPc6PR3giEhrdsxOCdqy5y1D mKTHdGJXSlemUAG2P7SgmNwpcVgyosIU8745nfmsrfKL2oJCTg8J3urTemI8iGh7odkx3qRPVb4Q P5XjS/BOnXjk00NNgqWeMHZ5KFIKHgrLGj8K0igqkO8PTQcH4K0QtKc7tAvsce2FGDs7cin2l7Du yc= X-UI-Out-Filterresults: notjunk:1;V03:K0:BRtrnStWGQc=:Vpb0xJM2jTf/xv4M1mc1h7 stOMxCMqcR2ERphengIYfb1TYxiPA4H6OaPSuD430mag4Kwp6KjVA4x2SjOMvXH+a+5sTSosW Xl7nU5hfVeoqPq7XrcUh09pDVwJZycw49wTjCVEapY8ar00+yvFVIHLfi/+HsLhsbfp62XeKF zSZmw7tm4h13isuFUvdyiP8auITih36r/u6NsSFyCsEP5Eqv0Hwd8RIoxEbK4hnzuNWbtVsoI 5JKyXl+UkaAOi+rCf7iqJChAZCqXiIAbwRjmgKb+6RXFsBnmyNp7+Lz7+gLQerO2wTseJPMEa 0VOxxXD/pfrsx+B2s60k79Nhr5+vgdxK+VjpZjxs9fAqI5ZXywoTT2Rg4x7HS+MGtB+69SCqw AlA+z5KWuzM2MHyMQJ55CBKBFwVCJrDxutdH6VrxZ6Hq9Vc18JYjt3pMjYpnHqjFgOfggFwLC Wy7P+IygUbPK4xpoSakhkhdZOojzq2DSoI3/RYHkeqfqASgvxLI9nKJlzHHmf47yP9QTuaFL0 MNg7d30DuADoBMQONds6tVjb4seQs40/p8xby+ggCUbWHT7rm5NCayW8+m5StoRv4JvJCn4Ib X8ZcSXNSD02J/tZJSSPMxLdLd1o0c698i4V0gyz3hBAyvG/MYCGMGfxRWbOVZte4iHNpUjkSc PS8RnSCpZ1dtzKYkcgIx3DvFeikS2SiDTYrjfT3nx/Ns5HId1X8Wt8MVLlRCMq79GUgDzKvvB jKlVqKjTnI7dTJ3/bXy2A648WoMMhnCD/35n80pEY6CMmJUSj9zlmfr+nh1i2L4jKSrNYqxwY 94+skOe Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, 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: Tue, 28 Sep 2021 19:15:45 -0000 Hi Tobias, let me first reach for my brown bag... > Otherwise, the quote from F2018 of my previous email applies: > > F2018:16.9.109 LBOUND has for "case(i)", i.e. with a 'dim' > argument the following. The case without 'dim' just iterates > through case (i) for each dim. Thus: > > "If DIM is present, > ARRAY is a whole array, > and either ARRAY is an assumed-size array of rank DIM > or dimension DIM of ARRAY has nonzero extent, > the result has a value equal to the lower bound for subscript DIM of A= RRAY. > Otherwise, if DIM is present, the result value is 1." It was probably too late, and I could no longer distinguish "assumed-size" from "assumed-rank", and likely some more... > Here, we assume dim=3D2 is present [either directly or via case(ii)], > ARRAY is a whole array but it neither is of assumed size nor has nonzero > extent. > Hence, the "otherwise" applies and the result is 1 - as gfortran has > and ifort has in the caller. ... which lead to my complete confusion and loss of focus. Of course you are right. Sorry for that. Will now put that bag on... Harald