[Bug fortran/126909] Lost statement label in a program with a CONTAINS section

"kargl at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126909

--- Comment #2 from Steve Kargl <kargl at gcc dot gnu.org> ---
This seems to be an issue with any program unit that
can have an internal subprogram.

subroutine lost
   print *, "Entered lost"
   call sub()
   goto 10
   print *, 'More Dead code'
   contains
      subroutine sub()
      end subroutine sub
10 end subroutine lost

% gfcx -c t2.f90
t2.f90:28:10:

   28 |    goto 10
      |          1
Error: Label 10 referenced at (1) is never defined
% flang21 -c t2.f90

flang21 compiles the code.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.