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 5C2D83857C74; Wed, 10 Mar 2021 21:52:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5C2D83857C74 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: u8ASbyiKsYddv5JaX5MtJi8O4o/FHKY5aoT+nvXvy8qAsl5dWUArL9oneYx7geg/4mqU2p79tZ mPIkIHrlNtJtlPjz5+VIjcGlz8LzRSlyBg4WLeaHzdDowDOAFc/yXM20Yb97i9a1tL8ycZqTul WjGJsFswk+CMKVOWPBWV9Wk8iORoIGWedZ9YYHrTyV7g/eAwKal4H18MF5Z1tdDcUCdJBdHD3U nsgkuYANgin5QYPpPIPNUn8ExFFl509BsXUwyV3SeS6ANNzJa4aQ/7KYuNTbdOltFym3SU4zl/ 4Kg= X-IronPort-AV: E=Sophos;i="5.81,238,1610438400"; d="scan'208";a="61300632" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 10 Mar 2021 13:52:17 -0800 IronPort-SDR: ZRo4ZOk4SjY8r9LGugSaVpIsJfdkhfRM4FHuF3J/vyprfpEC5/vhSyOpmdgxavQmJkfj4GpcWs 2gtf30ARcD6vJgLVhofMdm2qNSaj8TlGYNgnQD+r+lc1/jnEudmoUKw5LDbNNc2rvGZpIb67Tu oTV/ctWTy3fvuKvqtC5C8WuoD9UfJbjbp9hfo7qmtYz9fAojqFR83YmAwo84Zfjnee6T07aq35 4aXbFfHYJKvJH4KkTBuc0qQDBhb0wBbQ6+SWF5FE76UmCO9Ok4wvi+NXEPLb7YEJKtOK5ACRFu 0gw= Subject: Re: [PATCH] PR fortran/99205 - [10/11 Regression] Out of memory with undefined character length To: Harald Anlauf , Tobias Burnus CC: fortran , gcc-patches References: <8a63eb89-91e6-1e8d-870e-8a2f7a6750df@codesourcery.com> From: Tobias Burnus Message-ID: <2cc491ad-5f5f-ffcd-4f65-72512eaf888a@codesourcery.com> Date: Wed, 10 Mar 2021 22:52:11 +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-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.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, 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, 10 Mar 2021 21:52:19 -0000 Dear Harald, dear all, On 10.03.21 22:26, Harald Anlauf wrote: > [...] I found another testcase which lead to trouble during error > recovery due to a NULL pointer dereference. I was a bit surprised that the crash only occurs in trans*.c; however, the error 'non-constant initialization expression' is only issued by gfc_conv_constant, called via gfc_get_symbol_decl. Thus, when the error is shown we are already deep in trans*.c land. > Here's the updated changelog for the updated > patch (attached). I also renamed the first testcase so that they > fit better to the existing scheme. > > Again regtested on x86_64-pc-linux-gnu. Now OK for mainline / 10? LGTM for mainline and after a bit of waiting for GCC10. Thanks, Tobias > PR fortran/99205 - Out of memory with undefined character length > > A character variable appearing as a data statement object cannot > be automatic, thus it shall have constant length. > > gcc/fortran/ChangeLog: > > PR fortran/99205 > * data.c (gfc_assign_data_value): Reject non-constant character > length for lvalue. > * trans-array.c (gfc_conv_array_initializer): Restrict loop to > elements which are defined to avoid NULL pointer dereference. > > gcc/testsuite/ChangeLog: > > PR fortran/99205 > * gfortran.dg/data_char_4.f90: New test. > * gfortran.dg/data_char_5.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