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