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 21E753857C44; Tue, 26 Apr 2022 13:22:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 21E753857C44 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="74979983" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 26 Apr 2022 05:22:14 -0800 IronPort-SDR: mMtzvux5KpR9ONUga9VbFdP9o3lOEhYMHfBzNPOB8fSYq2N1jqpgf9LQbQeXCGgPoTOx69Nc/O 6qTNWv1BXpqnalpN5yata3LPGEsrUElqHkgIuL79If/q4EuI2LHYLkUziYQUKy3xi5H0aXCHtf 3fENqgHHbgzT8ry8covo251CZqZxnDpy+wYg6fxtlpAGHAfXtxdlQCctzabMQwDpJMsGbJEUIU lXb1i0K2WoI6a6dcaf5EwYPaCNsJGPAU6B7QoiYQEbAKpS4hvuzY9Z0xlN9d88vgvStfKI64Y4 WHA= Message-ID: <4567d0f0-3077-d582-e2d2-b0169c322009@codesourcery.com> Date: Tue, 26 Apr 2022 15:22:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] fortran: Avoid infinite self-recursion [PR105381] Content-Language: en-US To: Mikael Morin , gfortran , gcc-patches CC: Harald Anlauf References: <8f082ce4-a6a9-72c1-a882-4663426adaff@orange.fr> From: Tobias Burnus In-Reply-To: <8f082ce4-a6a9-72c1-a882-4663426adaff@orange.fr> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-6.3 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 26 Apr 2022 13:22:17 -0000 LGTM - however: On 26.04.22 14:38, Mikael Morin wrote: > --- a/gcc/fortran/trans-array.cc > +++ b/gcc/fortran/trans-array.cc > @@ -3698,7 +3698,8 @@ non_negative_strides_array_p (tree expr) > if (DECL_P (expr) > && DECL_LANG_SPECIFIC (expr)) > if (tree orig_decl =3D GFC_DECL_SAVED_DESCRIPTOR (expr)) > - return non_negative_strides_array_p (orig_decl); > + if (orig_decl !=3D expr) > + return non_negative_strides_array_p (orig_decl); Is the if()if()if() cascade really needed? I can see a reason that an extra 'if' is preferred for the variable declaration of orig_decl, but can't we at least put the new 'orig_decl !=3D expr' with an '&&' into the same if as the decl/in the second if? Besides clearer, it also avoids further identing the return line. Thanks, 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