[Bug fortran/120355] [15/16 Regression] Type mismatch for passed external function, if external function appears in the same source file

2025-05-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120355

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Thomas Koenig :

https://gcc.gnu.org/g:0e77309047a7b479c89f03dcaf2994e050d0f33e

commit r16-1003-g0e77309047a7b479c89f03dcaf2994e050d0f33e
Author: Thomas Koenig 
Date:   Fri May 30 13:31:58 2025 +0200

Type mismatch for passed external function

This obvious and simple patch fixes a 15/16 regression where the
typespec of a global function was in the RESULT clause and not
in the symbol itself.

gcc/fortran/ChangeLog:

PR fortran/120355
* interface.cc (compare_parameter): If the global function has a
result clause, take typespec from there for the comparison against
the dummy argument.

gcc/testsuite/ChangeLog:

PR fortran/120355
* gfortran.dg/interface_62.f90: New test.

[Bug fortran/120355] [15/16 Regression] Type mismatch for passed external function, if external function appears in the same source file

2025-05-20 Thread tkoenig at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120355

Thomas Koenig  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |tkoenig at gcc dot 
gnu.org

--- Comment #2 from Thomas Koenig  ---
I am AFK this week, will look at this next week. Thanks for the workaround,
Harald, this makes it quite clear what is going on.

[Bug fortran/120355] [15/16 Regression] Type mismatch for passed external function, if external function appears in the same source file

2025-05-19 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120355

--- Comment #1 from anlauf at gcc dot gnu.org ---
Workaround: don't use the result clause in the external function, e.g.

integer function s(x)
  implicit none
  integer, intent(in) :: x
  s = 1 - x
end function s

[Bug fortran/120355] [15/16 Regression] Type mismatch for passed external function, if external function appears in the same source file

2025-05-19 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120355

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug fortran/120355] [15/16 Regression] Type mismatch for passed external function, if external function appears in the same source file

2025-05-19 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120355

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

Summary|Type mismatch for passed|[15/16 Regression] Type
   |external function, if   |mismatch for passed
   |external function appears   |external function, if
   |in the same source file |external function appears
   ||in the same source file
 Ever confirmed|0   |1
   Last reconfirmed||2025-05-19
   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Target Milestone|--- |15.2