From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-27.smtpout.orange.fr [80.12.242.27]) by sourceware.org (Postfix) with ESMTPS id 215713858C2C for ; Sun, 14 May 2023 18:06:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 215713858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.16] ([86.215.161.51]) by smtp.orange.fr with ESMTPA id yG7Apbq7xOrpCyG7FpqqeJ; Sun, 14 May 2023 20:06:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1684087603; bh=5JbnSviNqb28dmk/HSBW+mIWX2TFRRhIWFG+c24oY6A=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=dMV9jlsvaYg+5ecX5/cjQdkfYdIMc4g7GMjZ7Pb9s7nZVAhrOfcTunXpa++mRjvdj 21RpR2OMmCQP+JkvAw1DwWbcBL0v/QSbBFMfixfnqWbruS7NseIN146ueL1ijfR1/q 6lB4JGb98EXO6yHfuBT56eSV0RRnG6ls6sQkAnjhiUtgK8msfI84tg6tO2moop6xz+ U5/iTvKOqlbxBAfBdNXPFR7+3MA20JkuI4+Io9aV64KxciHnMYCiJLo4oIzEUtIkh4 Q1LJc+6B/Vv1rVW7XmvVqEEw4ZA7b4rN7fIhff+zT4f556lZmGdHhoWjc6c1D8s0HR 30evIAmGx6JKA== X-ME-Helo: [192.168.1.16] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Sun, 14 May 2023 20:06:43 +0200 X-ME-IP: 86.215.161.51 Message-ID: <6cdaf95c-0894-3053-e3df-944dfcb6c910@orange.fr> Date: Sun, 14 May 2023 20:06:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2] Fortran: Narrow return types [PR78798] To: Bernhard Reutner-Fischer , Thomas Koenig Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org, Bernhard Reutner-Fischer References: <8B220543-5633-47CA-8DF9-0381613CBDF3@gmail.com> <20230510164719.155783-1-rep.dot.nop@gmail.com> <284716f0-fe76-dc88-e5be-4af0f65e13f4@netcologne.de> <20230514172428.2ff11996@nbbrfq> Content-Language: fr From: Mikael Morin In-Reply-To: <20230514172428.2ff11996@nbbrfq> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,JMQ_SPF_NEUTRAL,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Le 14/05/2023 à 17:24, Bernhard Reutner-Fischer a écrit : > On Sun, 14 May 2023 15:04:15 +0200 > Thomas Koenig wrote: > >> On 14.05.23 14:27, Mikael Morin wrote: >>> >>> (...) >>>> @@ -2098,7 +2098,7 @@ ref_same_as_full_array (gfc_ref *full_ref, >>>> gfc_ref *ref) >>>>           there is some kind of overlap. >>>>       0 : array references are identical or not overlapping.  */ >>>> -int >>>> +bool >>>>   gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse, >>>>             bool identical) >>>>   { >>> >>> The function comment states that the function may return 2, which >>> doesn't seem to be the case any more. >> >> Hm, this makes me a litte suspicious. Was functionality for reversing >> loops lost, maybe unintentionally? I assume that, at some time, we did >> use the '2' as return value (or did we?) > > There was 7c428aa29d75ef163c334cf3974f87b3630d8b8b (a revert because it > miscompiled spec2k) which might have associated the comment of the > former static gfc_dependency dep_ref (gfc_ref *lref, gfc_ref *rref, > gfc_reverse *reverse) to the current gfc_dep_resolver. > > The commit which introduced the return value 2 documentation was > 3d03ead0b8273efde57f6194617b35111a84b05d > "re PR fortran/24524 (Fortran dependency checking should reverse loops)" > > but TBH i don't see how it returned 2 in that revision? > Looks like when writing that patch it deemed useful to return 2 for > this specific situation but in the end it was dropped but the comment > survived. > Yes, I came to the same conclusion that we never returned 2 here. The information that reversal is needed is already provided on a per dimension basis by the gfc_reverse pointer passed as argument, so providing the information in the return value would be redundant anyway. > I will update the comment to document the true / false return values. > > And Mikael, do you want me to cleanup 1/0 to true/false assignments for > the boolean variables, or can we do that in a separate patch (or not at > all right now)? > I don't mind too much either way. As long as the variables are not assigned integer values outside of the [0,1] range, and we consistently use true/false or 0/1, not a mix of them, it's fine with me.