Re: [Fortran, Patch, PR98903, v1] Add parsing and code gen for TEAM_NUMBER in coindexes.

2025-03-12 Thread Andre Vehreschild
Hi Harald,

thanks for the review. Committed with the requested changes (intrinsic module
ISO_FORTRAN_ENV and indexes -> indices in the description) as
gcc-15-7997-gbaa9b2b8d2e

I haven't added F2023 NOTIFY= image-selector yet, because at the moment I am
striving to get F2018 more complete.

Thanks again for the review.

Regards,
Andre

On Tue, 11 Mar 2025 21:49:05 +0100
Harald Anlauf  wrote:

> Hi Andre!
>
> Am 11.03.25 um 17:13 schrieb Andre Vehreschild:
> > Hi all,
> >
> > attached patch adds parsing of TEAM_NUMBER= named arguments in coindexed
> > expressions. The patch also ensures that once in an image_selector_list no
> > more regular coarray indexes are accepted, i.e. coarray[1,2,3, STAT=S, 5] is
> > rejected, because the 5 must not come after any of (STAT, TEAM,
> > TEAM_NUMBER).
>
> This agrees with how I read F2023:
>
> R926: image-selector  is
>   lbracket cosubscript-list [ , image-selector-spec-list ] rbracket
>
> R928: image-selector-spec  is
>   NOTIFY = notify-variable
> or
>   STAT = stat-variable
> or
>   TEAM = team-value
> or
>   TEAM_NUMBER = scalar-int-expr
>
> > The availability of TEAM_NUMBER is from F2018 onwards, although F2015
> > already defined it. But because F2015 is not present as standard in
> > GFortran I moved it to F2018.
>
> We had a f2008ts for TS29113 as an intermediate version, but this is now
> the same as f2018 (see options.cc).  I would rather not refer to F2015,
> this sounds outdated to me...  F2018 is the right thing.
>
> I would also explicitly refer to the *intrinsic module* ISO_FORTRAN_ENV
> in the following error message, as we do that elsewhere:
>
> +   gfc_error ("TEAM argument at %L must be of TEAM_TYPE from "
> +  "ISO_FORTRAN_ENV module, found %s",
> +  &ar->team->where,
> +  gfc_basic_typename (ar->team->ts.type));
>
>
> > Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline?
>
> Besides some spelling nits, this is OK.
>
> Note: I am not a native speaker, but please check the following:
>
> "indexes" -> indices,
> "coindexes" -> coindices (or co-indices?)
>
> (you wont find any "indexes" in the standard document)
>
> "coindexed" is correct.
>
> > I have seen that in the PR also FORM TEAM and fellows is used, but left them
> > out of the test, because those are addressed in PR87326. That PR is not yet
> > merged. I intent to rebase, complete/adapt and merge it next. Then also
> > caf_single gets support for team expressions. And of course OpenCoarrays.
>
> This is fine.  Let's go step by step.
>
> Thanks for the patch!
>
> Harald
>
> > Regards,
> > Andre
> > --
> > Andre Vehreschild * Email: vehre ad gmx dot de
>


--
Andre Vehreschild * Email: vehre ad gmx dot de


Re: Regression? Re: [patch, fortran] Fix PR 119078, putting a procedure in an abstract interface into global namespace

2025-03-12 Thread Thomas Koenig

Hi Andre,


FAIL: gfortran.dg/binding_label_tests_26b.f90   -O   (test for errors, line 8)
FAIL: gfortran.dg/binding_label_tests_26b.f90   -O   (test for errors, line 9)

When I revert your patch and test again, above fails do not occur. Could you
please investigate, if I am right?


Jep, I missed that.

The warning in the test case is bogus.  binding_label_tests_26a.f90 has

module fg
contains
  function fffi(f)
interface
   function f() bind(c)
   end function
end interface
  end function
end module

so f is a dummy argument, which is not a global entity.

binding_label_tests_26b.f90 has

module f! { dg-error "uses the same global identifier" }
  use fg! { dg-error "uses the same global identifier" }
end module

so it tests for that error.

The test case should stay, but I will remove the dg-error directives.

Best regards

Thomas



Re: Regression? Re: [patch, fortran] Fix PR 119078, putting a procedure in an abstract interface into global namespace

2025-03-12 Thread Thomas Koenig

Am 12.03.25 um 18:33 schrieb Thomas Koenig:


The test case should stay, but I will remove the dg-error directives.


Fix committed as obvious and simple as r15-8006 .

Thanks for the heads-up!

Best regards

Thomas



Regression? Re: [patch, fortran] Fix PR 119078, putting a procedure in an abstract interface into global namespace

2025-03-12 Thread Andre Vehreschild
Hi Thomas,

I think this patch produced a regression:

FAIL: gfortran.dg/binding_label_tests_26b.f90   -O   (test for errors, line 8)
FAIL: gfortran.dg/binding_label_tests_26b.f90   -O   (test for errors, line 9)

When I revert your patch and test again, above fails do not occur. Could you
please investigate, if I am right?

Regards,
Andre

On Tue, 11 Mar 2025 17:45:16 +0100
Thomas Koenig  wrote:

> Am 11.03.25 um 10:22 schrieb Andre Vehreschild:
> > Hi Thomas,
> >
> > looks good to me as well. Thanks for the patch.
>
> Committed as r15-7964.
>
> Thanks Harald and Andre!
>
> Best regards
>
>   Thomas
>


--
Andre Vehreschild * Email: vehre ad gmx dot de