On 2/13/25 11:59 AM, Thomas Koenig wrote:
Hello world,

this was an interesting regression.  It came from my recent
patch, where an assert was triggered because a procedure artificial
dummy argument generated for a global symbol did not have the
information if if was a function or a subroutine.  Fixed by
adding the information in gfc_get_formal_from_actual_arglist.

This information then uncovered some new errors, also in the
testsuite, which needed fixing.  Finally, the error is made to
look a bit nicer, so the user gets a pointer to where the
original interface comes from, like this:

   10 |     CALL bar (test2) ! { dg-error "Interface mismatch in dummy procedure" }
       |              1
......
   16 |     CALL bar (test) ! { dg-error "Interface mismatch in dummy procedure" }
       |              2
Fehler: Interface mismatch in dummy procedure at (1) conflichts with (2): 'test2' is not a subroutine

Regression-tested. OK for trunk?

This is OK. It would be good to get confirmation that the lapack builds now. I use to be set up here to do that, but dont have it at the moment.

Thanks for the quick fix.

Jerry

Best regards

     Thomas

gcc/fortran/ChangeLog:

     PR fortran/118845
     * interface.cc (compare_parameter): If the formal attribute has been
     generated from an actual argument list, also output an pointer to
     there in case of an error.
     (gfc_get_formal_from_actual_arglist): Set function and subroutine
     attributes and (if it is a function) the typespec from the actual
     argument.

gcc/testsuite/ChangeLog:

     PR fortran/118845
     * gfortran.dg/recursive_check_4.f03: Adjust call so types matche.
     * gfortran.dg/recursive_check_6.f03: Likewise.
     * gfortran.dg/specifics_2.f90: Adjust calls so types match.
     * gfortran.dg/interface_52.f90: New test.
     * gfortran.dg/interface_53.f90: New test.

Reply via email to