From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id E59023888012; Fri, 23 Jul 2021 07:58:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E59023888012 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: 04DEua5kXFpC7cTu4jrxz4q3bD2Xwsv5jSKbUFqBOS0Mpdw09/SJOTYdw4b6kxZxNWgdqOWy7C tR/blpwMg0nFblMaP237R2RdBwvGDv5QC0hggE6uldndeZotW/Q0woCR8yY15PJij8Vg5ba8O6 K0yMVcllgW9RfsKpVbOvU6dYapkfkS3pBpfJwQs4oq5bV/MREy0u07i/ZYA5v7C6x+s05uS51j SHhskMPbkWjIS2Ngz2fOsTfcqU2Pa1/MG/mPGGq1vBijTlv5HqndmSlzkfPqNO4MudhdZb6W0K y0DuBCF7+M/pX55A1IpC4wV4 X-IronPort-AV: E=Sophos;i="5.84,263,1620720000"; d="scan'208";a="63844812" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 22 Jul 2021 23:58:25 -0800 IronPort-SDR: nrh+w5KLILJE067O/e5GEt0034F9JFUSsm2wo3wf3uG3ld+XRvch6U2qQxlugJ2rCi+DLI7nGl ab+dGtGps1YaR1qwF1Go0OVEbHTjiAzuM8scoGPt5K6bV947NiENR6LfQIgFtWsfzE3GaKZ+SV Y4ghB8rM3miNScvYXyCzTmeMONxunBrOSbBwk+YPso9dAVAXHHLIzx47oBh2+lWXYm5D25b3E5 qdPDWrnJhTR74UI3yc5/aLQwavZAYHLzrTt1/SgXBeBm+I/QqMeEi53v6R+NML7CD79HyZss3K r74= Subject: Re: [PATCH] PR fortran/101536 - ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:7324 To: Harald Anlauf CC: fortran , gcc-patches References: From: Tobias Burnus Message-ID: <449b9a29-4df4-9a5b-7675-a11db7aebe1f@codesourcery.com> Date: Fri, 23 Jul 2021 09:58:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) 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_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, 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: Fri, 23 Jul 2021 07:58:28 -0000 Hi Harald, On 22.07.21 21:03, Harald Anlauf wrote: > you are right in that I was barking up the wrong tree. > I was focussed too much on the testcase in the PR. > [...] > Well, I tried and this does not work. Which makes sense if one thinks about it: When using 'a(5,:)', the parser already sets e->rank =3D 1. while for 'a', the 'a' is the class wrapper with rank =3D=3D 0 and then overriding the e->rank by CLASS_DATA(e)->as.rank + adding AR_FULL makes sense. > However, an additional plain check on e->rank !=3D 0 also in the > CLASS cases fixes the original issue as well as your example: [...] > And regtests ok. :-) > See attached updated patch. I think you still need to remove the 'return true;' from the 'if (e->rank !=3D 0 && e->ts.type =3D=3D BT_CLASS' block =E2=80=93 to fall through to the e->rank check after the block. (When 'return true;' is gone, the '{' and '}' can also be removed.) Reason: Assume 'CLASS(...) x'. In this case, 'x' is a scalar. And even after calling gfc_add_class_array_ref it remains a scalar and e->rank =3D=3D 0. Or in other words: I think with your current patch, class(u) :: z f =3D size (z) is wrongly accepted without an error. Thus: OK with a scalar CLASS entry added which gives an error, which I believe requires the removal of the 'return true;' line. Thanks for the patch =E2=80=93 and I find it surprising how many combinations exist which all can go wrong. 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