From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id A1F5E385780D; Mon, 13 Sep 2021 08:21:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A1F5E385780D 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: I315KA31NTcIOwwPjnKbeAedyYSqfG09m1Hq5sqTsdYS4Y3G7LV2a/TWkeGPwuen/tn+um+Qy6 y1ebMFZ3wB0RmCMOAtDc6/kdbw9D0ncVDbOEdZwz6QpBGM7jxnM5nQ4c/yHQi0l462Dn5YsP6i a/h+xHbb4ia/Ifn0iOxR+HueNdi3iHgclsUj7cvDKYyQmI4lU24zdYhayArLAYu7Er4HXLbmqz bXWH9pvxdri4GWVM+otBZrAZv9fAAAI1QdQCsMECxJAH54d49CIZAvS4/QaT8LEm7Ov5jZwMSM DXsZUykOcd6Zo9lfU8MpFMCN X-IronPort-AV: E=Sophos;i="5.85,288,1624348800"; d="scan'208";a="65973213" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 13 Sep 2021 00:21:20 -0800 IronPort-SDR: v46xXP4s5iJXFtD6UJ9/D6sXnL0vvzCM1bIG8tsj8usCkampVhhMZuayvGmW5krmvpEYTVw+Xd 1zUkVe64+iqCBXaufXX3t1cammG7kpkfGQViqTeKnW3/prIZjb6jKXKWpq22i8Sy9dpEboFET4 5ButyrOAUMNnaYiBrTTnwONktYQeSVbrPtiSNQuX05gK52KRILaPiS4P6HmRRZiYharHR+YqRS jZNpIWL0G4Zeip5qq1TSvhCEby3uVofx1mtoL69RW1/JcHYRIuhkT1KhOK10SWvLHf19iil9lQ yng= Subject: Re: [PATCH] PR fortran/82314 - ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:6972 To: Harald Anlauf , fortran , gcc-patches References: From: Tobias Burnus Message-ID: <8e87fafb-6edf-b7a4-fd5a-1d10f1950d3b@codesourcery.com> Date: Mon, 13 Sep 2021 10:21:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.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-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_NUMSUBJECT, 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: Mon, 13 Sep 2021 08:21:23 -0000 On 07.09.21 23:44, Harald Anlauf via Fortran wrote: > When adding the initializer for an array, we need to make sure that > array bounds are properly simplified if that array is a PARAMETER. > Otherwise the generated initializer could be wrong and screw up > subsequent simplifications, see PR. > > The minimal solution is to attempt simplification of array bounds > before adding the initializer as in the attached patch. (We could > place that part in a helper function if this functionality is > considered useful elsewhere). > > Regtested on x86_64-pc-linux-gnu. OK for mainline? OK. Thanks for the patch, Tobias > Fortran - ensure simplification of bounds of array-valued named constants > > gcc/fortran/ChangeLog: > > PR fortran/82314 > * decl.c (add_init_expr_to_sym): For proper initialization of > array-valued named constants the array bounds need to be > simplified before adding the initializer. > > gcc/testsuite/ChangeLog: > > PR fortran/82314 > * gfortran.dg/pr82314.f90: New test. > ----------------- 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