https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108850
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #3)
> I have no idea how the above code tricks gfortran into thinking there is
> a variable 'select' ...
It might be a bad interaction of the PUBLIC statement with parsing of
BLOCK and contained statements, which is quite general. Interchanging
subroutines just hides the issue to the resolution.
Any symbol which has the same name as a Fortran statement is likely affected,
as the following (legal) variants show:
module m2
implicit none
public :: do
contains
subroutine a
block
do
end do
end block
end subroutine a
!
subroutine do
block
do
end do
end block
end subroutine do
end module m2
module m3
implicit none
public :: print
contains
subroutine a
block
print *
end block
end subroutine a
!
subroutine print
block
print *
end block
end subroutine print
end module m3
module m4
implicit none
public :: block
contains
subroutine a
block
block
end block
end block
end subroutine a
!
subroutine block
block
block
end block
end block
end subroutine block
end module m4