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 EE39F3950437; Wed, 24 Feb 2021 16:28:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EE39F3950437 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: LiLMiWMl3Zdtz0kta4YCAU6QpIwvuF9teNpW55RZ8trpK1i3/mFjBvFxDp+sMdeTMtrHs5QcOk zcQ7g0dvm/i5rqY1H7XENIHdiR4unKAsFFI/zYoAW4J3wkUyklYglC+ICq6X9VnTaGCo97urqH MxL0TX4bbcExAC7Z1Q5ZbSySjjjDa3kgFJVN3npvgz/MSXgfm69Xz7xtP+YVJnUoLfakvPGyxb +/nCJHR6CMlmXiRRqqwm029CoQGImwgqCgoDmuC1Hx6IcChPjxi4RngVWn869EKT2mibcA0mDg ZoM= X-IronPort-AV: E=Sophos;i="5.81,203,1610438400"; d="scan'208";a="58438283" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 24 Feb 2021 08:28:23 -0800 IronPort-SDR: zIoQBFyZDj0d4kWDMS/MCKgl7XYofXuFfV3EDiMzdd2PMfxw6bZZjZmqbniKTqt+21QiwpLq1n FVdJlP5p9Gb+tiOYeR2E2vrChWMlHcB583SmKoJDZEUS1O0sUsorLQYsT6dBZXaHeNn+t2Yywn 85nxiaV4IVNzTtSNRqFRYG3dyOSxBem1I3yvwbKbMZFDrANd1HH1VG909YJnbwNqyFjlMa/Ha8 DJufGh0xLLljPtKdS5RxNwW0zy8oIiwDDhZELqLv3sRDpA1IS7pnw98HziyEfEh4+XZKfAxiMD l3Y= Subject: Re: [Patch, fortran] PR99125 - [9/10/11 Regression] ICE: gimplification failed (gimplify.c:15068) To: Paul Richard Thomas , "fortran@gcc.gnu.org" , gcc-patches CC: References: From: Tobias Burnus Message-ID: <3e9e63b0-e9d0-a529-dbdf-96665e206d6b@codesourcery.com> Date: Wed, 24 Feb 2021 17:28:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.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-03.mgc.mentorg.com (139.181.222.3) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2021 16:28:29 -0000 Hi Paul, On 24.02.21 15:05, Paul Richard Thomas via Fortran wrote: > This problem was caused by the compiler attempting to use 0 as an lvalue > and to assign 0 to it. I did recall the problem =E2=80=93 and indeed: PR95868. The trans-array.c patch does effectively the same as mine there, some other use of 'tmp' but otherwise ... The trans-expr patch, I didn't have; unfortunately, it does not solve the other issues of my PR, either. (Thus, if you are interested in continuing the len=3D: work ...) [Once that PR is fixed, trans-openmp.c has to updated for it as well.] > Understandably, this upset the gimplifer quite a bit > :-) The fix is to use the ss_info string length for deferred length > character components, where the hidden string length component has been > used. The use of a constant as an lvalue is prevented by checking that th= e > expression string length is a variable. > > Regtests on FC33/x86_64 - OK for all three branches? LGTM. Thanks for the patch! Tobias > Fortran: Fix for class defined operators [PR99125]. > > 2021-02-23 Paul Thomas > > gcc/fortran > PR fortran/99125 > * trans-array.c (gfc_conv_expr_descriptor): For deferred length > length components use the ss_info string length instead of > gfc_get_expr_charlen. Make sure that the deferred string length > is a variable before assigning to it. Otherwise use the expr. > * trans-expr.c (gfc_conv_string_length): Make sure that the > deferred string length is a variable before assigning to it. > > gcc/testsuite/ > PR fortran/99125 > * gfortran.dg/alloc_deferred_comp_1.f90: New test. ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen R= egistergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas H= eurung, Frank Th=C3=BCrauf