gfortran 4.9 and 4.10 reject the code below with: subroutine sub(x) integer, intent(in) :: x entry sub_c(x) bind(c) end subroutine sub a.f90:3.16-16: entry sub_c(x) bind(c) 12 Error: Procedure sub_c with binding label sub_c at (1) uses the same global identifier as entity at (2) As far as I can tell, this code is standard-conforming (related to non-legal code from PR 35031). It should be accepted.
The code is accepted up to r199034 (2013-05-17) and rejected after r199221 (2013-05-22). Likely r199118, r199119, or r199120 (pr 48858).
> The code is accepted up to r199034 (2013-05-17) and rejected after r199221 > (2013-05-22). Likely r199118, r199119, or r199120 (pr 48858). It is r199120.
GCC 4.9.3 has been released.
GCC 4.9 branch is being closed
GCC 6 branch is being closed
Related to/duplicate of pr34500.
Author: kargl Date: Sun Jan 13 04:02:46 2019 New Revision: 267902 URL: https://gcc.gnu.org/viewcvs?rev=267902&root=gcc&view=rev Log: 2019-01-12 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/61765 * resolve.c (gfc_verify_binding_labels): Break if-elseif-elseif structure into independent if's with a return to simplify logic. Avoid a check for ENTRY name with bind(c). 2019-01-12 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/61765 * gfortran.dg/pr61765.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/pr61765.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog
Fixed on trunk. Closing.
For the record, after revision r267902 the test in pr34500 comment 0 gives an ICE instead of a wrong error (see pr34500 comment 6).