On Sun, 14 May 2023 15:04:15 +0200
Thomas Koenig <[email protected]> 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.
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)?
many thanks for the reviews!