[PATCH 1/2] testsuite: Declare fortran array bound variables

2024-03-17 Thread Mikael Morin
This fixes invalid undeclared fortran array bound variables in the testsuite. gcc/testsuite/ChangeLog: * gfortran.dg/graphite/pr107865.f90: Declare array bound variable(s) as dummy argument(s). * gfortran.dg/pr101267.f90: Likewise. * gfortran.dg/pr112404.f90: Likew

[PATCH 2/2] fortran: Fix specification expression error with dummy procedures [PR111781]

2024-03-17 Thread Mikael Morin
This fixes a spurious invalid variable in specification expression error. The problem is caused by improper restoration of formal_arg_flag to false (instead of restoring it to its previous value). This happens with the testcase from the PR where a dummy argument is itself a procedure with dummy ar

[PATCH 0/2] fortran: Fix specification checks [PR111781]

2024-03-17 Thread Mikael Morin
Hello, these patches correct diagnostics dealing with variables in specification expressions. The first patch is a testsuite change, which fixes invalid specification expressions that the second patch would diagnose. The second patch removes a spurious diagnostic when a dummy procedure is involved

[PATCH v2 0/2] fortran: Fix specification checks [PR111781]

2024-03-17 Thread Mikael Morin
Meh, the first version contained out-of-date patches. these patches correct diagnostics dealing with variables in specification expressions. The first patch is a testsuite change, which fixes invalid specification expressions that the second patch would diagnose. The second patch removes a spuriou

[PATCH v2 1/2] testsuite: Declare fortran array bound variables

2024-03-17 Thread Mikael Morin
This fixes invalid undeclared fortran array bound variables in the testsuite. gcc/testsuite/ChangeLog: * gfortran.dg/graphite/pr107865.f90: Declare array bound variable(s) as dummy argument(s). * gfortran.dg/pr101267.f90: Likewise. * gfortran.dg/pr112404.f90: Likew

[PATCH v2 2/2] fortran: Fix specification expression error with dummy procedures [PR111781]

2024-03-17 Thread Mikael Morin
This fixes a spurious invalid variable in specification expression error. The problem is caused by improper restoration of formal_arg_flag to false (instead of restoring it to its previous value). This happens with the testcase from the PR where a dummy argument is itself a procedure with dummy ar

Re: [PATCH v2 2/2] fortran: Fix specification expression error with dummy procedures [PR111781]

2024-03-17 Thread Harald Anlauf
Hi Mikael, thanks for the patch! Regarding the first part of the patch, I think that fixing bad testcases can be done at any time. Retaining identified, broken testcases means that one may hit bogus regressions, hindering progress. The second part of the patch looks at first glance fine to me.

Re: [PATCH, v2] Fortran: fix for absent array argument passed to optional dummy [PR101135]

2024-03-17 Thread Mikael Morin
Le 15/03/2024 à 20:32, Harald Anlauf a écrit : Dear all, as there has been some good progress in the handling of optional dummy arguments, I looked again at this PR and a patch for it that I withdrew as it turned out incomplete. It turned out that it now needs only a minor adjustment for option

Re: [PATCH v2 2/2] fortran: Fix specification expression error with dummy procedures [PR111781]

2024-03-17 Thread Mikael Morin
Le 17/03/2024 à 21:57, Harald Anlauf a écrit : Hi Mikael, thanks for the patch! Regarding the first part of the patch, I think that fixing bad testcases can be done at any time.  Retaining identified, broken testcases means that one may hit bogus regressions, hindering progress. The second par

Re: [PATCH, v2] Fortran: fix for absent array argument passed to optional dummy [PR101135]

2024-03-17 Thread Harald Anlauf
Hi Mikael, On 3/17/24 22:04, Mikael Morin wrote: diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 3673fa40720..a7717a8107e 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -7526,6 +7526,17 @@ gfc_get_dataptr_offset (stmtblock_t *block, tree pa