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 748E2385BF86; Wed, 6 Oct 2021 10:24:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 748E2385BF86 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: cQ1uhOWkkogmCljKH2dpvbMdybe3l+60Vz6xfC5MIt/7H24megzk/e6GtlGW48780BFN88nu/i vYNB1UNtWbI7p+iqgul3w818xd6XAFGr4NWM/SMd70XPTVetjuoFFDirqzsC+drMcKG2ScNMwm fv0zWO902g7sj3lFoE7ZWMOU+gkagyC4Vr8dmHzJAFOw9qyG5H3v/O8pPass10ZBnuIRHiYEGf 8F5B4kN499DXZCvA9SxC9hR8zzIuMyxxL7sX1kMETtDxEjl0mNIGNl+1JtaL6EneH7Iou57ZjY 40+BZ9EsKvfMdI84a/KNQDnk X-IronPort-AV: E=Sophos;i="5.85,350,1624348800"; d="scan'208";a="69276737" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 06 Oct 2021 02:24:23 -0800 IronPort-SDR: zcgEwq1UCS28iGOcec1/MGBSSXAqV8jdjxc1VtJlhFu5z2J5UAPGVOuUdEY7Jxm13oR6xuMKnj 9yhQFZbWrzQyE+lp+hT3Msdj7plrnKGNruKLCJoMuLaXKU89BIzVGxU6WI+eoZFZd1vuY2J5gL G8BSiLlBUYVxc5VmZh/zaa+xsE20iwk1Nzpvc7Qne4iLiBmqf6JeC1Liv7YTXWzrY8ZqjNByzR mQi4vTeghBfC6FIuyP8ksQiL+vPHoLoorQyphnEz+nNAMJVNE7QWYjNMMTycA5QdlcGbJQMwdg Dzk= Message-ID: Date: Wed, 6 Oct 2021 12:24:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: PING - (Re: [Patch] Fortran: Various CLASS + assumed-rank fixed [PR102541]) Content-Language: en-US From: Tobias Burnus To: gcc-patches , fortran References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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: Wed, 06 Oct 2021 10:24:26 -0000 Early ping for this patch. (I still plan to review Harald's pending patch soon, unless someone beats me: https://gcc.gnu.org/pipermail/gcc-patches/2021-October/580810.html ) On 01.10.21 02:43, Tobias Burnus wrote: > Hi all, > > this patch fixes a bunch of issues with CLASS. > > * * * > > Side remark: I disliked the way CLASS is represented when it was > introduced; > when writing the testcase for this PR and kept fixing the testcase > fallout, > I started to hate it! > I am sure that there are more issues =E2=80=93 but I tried hard not too l= ook > closer > at surrounding code to avoid hitting more issues. > (If you look for a project, I think if you put attributes on separate > lines, > like a separate "POINTER :: var" line, you have a high chance to hit the > error.) > > * * * > > What I found rather puzzling is that the 'optional' argument could be > either > on sym->attr.optional or on CLASS_DATA (sym)->attr.optional. I think one > occurs for 'foo2' and the other for 'foo4' - not that I understand why it > differs. > > I think it is otherwise straight forward. Regarding the original issue: > > In order to detect an assumed-size argument to an assumed-rank array, > the last dimension has 'ubound =3D -1' to indicate an assume-size array; > for those size(x, dim=3Drank(x)-1) =3D=3D -1 and size(x) < 0 > > However, when the dummy argument (and hence: actual argument) is either > a pointer or an allocatable, the bound is passed as is (in particular, > "-1" is a valid ubound and size(x) >=3D 0). =E2=80=93 However, if the act= ual > argument is unallocated/not associated, rank(var) still is supposed to > work - hence, it has to be set. > > The last two items did work before - but not for CLASS -> CLASS. > Additionally, > the ubound =3D -1 had an issue for CLASS -> TYPE as the code assumed that > expr->ref is the whole array ("var(full-array-ref)") but for CLASS the > expr->ref is a component and only expr->ref->next is the array ref. > ("var%_data(full-array-ref)"). > > OK for mainline? > > Tobias > ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955