public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <morin-mikael@orange.fr>
To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>,
	Thomas Koenig <tkoenig@netcologne.de>
Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org,
	Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
Subject: Re: [PATCH v2] Fortran: Narrow return types [PR78798]
Date: Sun, 14 May 2023 20:06:35 +0200	[thread overview]
Message-ID: <6cdaf95c-0894-3053-e3df-944dfcb6c910@orange.fr> (raw)
In-Reply-To: <20230514172428.2ff11996@nbbrfq>

Le 14/05/2023 à 17:24, Bernhard Reutner-Fischer a écrit :
> On Sun, 14 May 2023 15:04:15 +0200
> Thomas Koenig <tkoenig@netcologne.de> 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.




  reply	other threads:[~2023-05-14 18:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 23:45 [PATCH 0/5] function result decl location; type demotion Bernhard Reutner-Fischer
2022-11-12 23:45 ` [PATCH 1/5] c: Set the locus of the function result decl Bernhard Reutner-Fischer
2022-11-14 21:25   ` Joseph Myers
2022-11-12 23:45 ` [PATCH 2/5] c++: " Bernhard Reutner-Fischer
2022-11-15 23:52   ` Jason Merrill
2022-11-17  8:56     ` Bernhard Reutner-Fischer
2022-11-17 14:53       ` Jason Merrill
2022-11-17 19:02         ` Bernhard Reutner-Fischer
2022-11-17 23:52           ` Jason Merrill
2022-11-18 10:49             ` Bernhard Reutner-Fischer
2022-11-18 16:06               ` Jason Merrill
2022-11-18 18:26                 ` Bernhard Reutner-Fischer
2022-11-19  9:56                 ` Bernhard Reutner-Fischer
2022-11-20 17:06                   ` Bernhard Reutner-Fischer
2022-11-22 20:25                     ` Jason Merrill
2022-11-23 15:28                       ` Jason Merrill
2022-12-02 19:30                         ` Jason Merrill
2022-12-02 19:55                           ` Bernhard Reutner-Fischer
2022-11-12 23:45 ` [PATCH 3/5] Fortran: Narrow return types [PR78798] Bernhard Reutner-Fischer
2022-11-13 10:13   ` Janne Blomqvist
2022-11-13 10:39     ` Bernhard Reutner-Fischer
2022-11-13 20:29       ` Harald Anlauf
2022-11-13 20:29         ` Harald Anlauf
2022-11-13 21:50         ` Bernhard Reutner-Fischer
2023-05-10 16:47           ` [PATCH v2] " Bernhard Reutner-Fischer
2023-05-14 12:27             ` Mikael Morin
2023-05-14 13:04               ` Thomas Koenig
2023-05-14 15:24                 ` Bernhard Reutner-Fischer
2023-05-14 18:06                   ` Mikael Morin [this message]
2023-05-18 19:52               ` Bernhard Reutner-Fischer
2022-11-12 23:45 ` [PATCH 4/5] value-range: Add as_string diagnostics helper Bernhard Reutner-Fischer
2022-11-12 23:55   ` Andrew Pinski
2022-11-17  3:30     ` Jeff Law
2022-11-12 23:45 ` [PATCH 5/5] gimple: Add pass to note possible type demotions; IPA pro/demotion; DO NOT MERGE Bernhard Reutner-Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6cdaf95c-0894-3053-e3df-944dfcb6c910@orange.fr \
    --to=morin-mikael@orange.fr \
    --cc=aldot@gcc.gnu.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rep.dot.nop@gmail.com \
    --cc=tkoenig@netcologne.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).