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 040C33857005; Thu, 27 Aug 2020 07:46:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 040C33857005 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: NPSAzzuU2wUfSXddiWpWeK43MamI8T69sOH3YLsMUFMzbYcy6e6tnu+QB992BQsiE0fk4nTMZ8 gytgcOzjDbPoWxldyCXPhcj8Ysx3Gpsf24HfcSuKsnbBk1QAKU9e+S6pnBCE0Bh8IzHqWY/nLw Spho1Aqao9qLQHDmzJ+n3CSIZXlQXW1RsKORXrEjRGkez0yGIYEwY/JE6oIpRzqEuUjtOsxEny di1gD46ljEt9pbJhmTXS/tjyrh3OLlzx2vB3mlkFLQkaVNZ/YLHjE9jKLa/pkskoYpXxB7F2cf /8Y= X-IronPort-AV: E=Sophos;i="5.76,359,1592899200"; d="scan'208";a="52325151" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 26 Aug 2020 23:46:19 -0800 IronPort-SDR: o/ZlWeJeXWDFEUF+WL+xe5wr544uJpkRs6tT12lrn+PmwvZ7wrDYawvVLbdxRm3TNh8fKucHGs ShO8Vg26udU5nssQ/Nd8kHiS47MM3oWbLhRChgYMxRoWKQZWAoSo4+v0pulzqAT0mx2qbwm9Fp VylBkSj4z8H/kZ0Vq6pPUU9xrMrS6EeQSrpcuPP/wBOG4FcMuxqtfjQMitSj6psMOh6yz50l2p feRhSqdQs7JYZjquMLNRZCBEe7AwKJ+oNgw/vupv25UTlI6takZBhxUefQZSs6UejZ2u83Z+d6 rqM= Subject: Re: [Patch, fortran] PR96624 - A segment fault occurred when using the reshape function result to assign a variable To: Paul Richard Thomas , "fortran@gcc.gnu.org" , gcc-patches References: From: Tobias Burnus Message-ID: Date: Thu, 27 Aug 2020 09:46:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.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-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=-8.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham 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: Thu, 27 Aug 2020 07:46:21 -0000 Looks good to me. Thanks for the patch! Tobias On 8/27/20 8:17 AM, Paul Richard Thomas via Fortran wrote: > Hi All, > > Here is another of Steve Kargl's patches. > > Before the patch is applied, the following code is generated: > atmp.0.span =3D 4; > atmp.0.data =3D 0B; > atmp.0.offset =3D 0; > (*(integer(kind=3D4)[0] * restrict) atmp.0.data)[0] =3D 1; > (*(integer(kind=3D4)[0] * restrict) atmp.0.data)[1] =3D 2; > > which causes a segfault at run time. The test case counts the number of > occurrences of 'data' to check that the bad assignments have gone. > > Regtests OK on FC31/x86_64 - OK for aster? > > This patch fixes PR96624. > > 2020-08-27 Paul Thomas > > gcc/fortran > PR fortran/96624 > * simplify.c (gfc_simplify_reshape): Detect zero shape and > clear index if found. > > gcc/testsuite/ > PR fortran/96624 > * gfortran.dg/reshape_8.f90 : New test. ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstra=C3=9Fe 201, 80634 M=C3=BCnch= en / Germany Registergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas = Heurung, Alexander Walter