Re: [Patch, fortran] PR126909 - Lost statement label in a program with a CONTAINS section
Steve Kargl <[email protected]>
| Newsgroups | gmane.comp.gcc.patches,gmane.comp.gcc.fortran |
|---|---|
| Message-ID | <[email protected]> |
On 8/20/26 03:12, Paul Richard Thomas wrote:
> Please find attached a rather trivial fix for this PR.
>
> The patch passes regression testing on FC44/x86_64. OK for mainline?
>
> Paul
Paul,
Thanks for the patch, but I fear it's a bit more
complicated. The patch only treats a labeled
'end program' statement, but I think it needs to
deal with additional 'branch target statements'
(F2018, 3.18). That is, it needs to also consider
things like
subroutine lost()
call sub()
goto 11
contains
subroutine sub()
goto 10
10 return
end subroutine sub
11 end subroutine lost
and, it needs to catch invalid labels such as
F2018, 6.2.5 Statement labels
...
The same statement label shall not be given to more than
one statement in its scope.
subroutine lost()
call sub()
goto 10
contains
subroutine sub()
goto 10
10 return
end subroutine sub
10 end subroutine lost
--
steve