[Bug fortran/38507] Bogus Warning: Deleted feature: GOTO jumps to END of construct
kargl at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Dec 12 23:00:00 GMT 2008
------- Comment #4 from kargl at gcc dot gnu dot org 2008-12-12 22:58 -------
(In reply to comment #3)
> What is about the obsolescent DO related part? Do we need to do
> something there
> (from F95, B.2):
>
> "Shared DO termination and termination on a statement other than END DO or
> CONTINUE Â use an END DO or a CONTINUE statement for each DO statement."
>
AFAICT, gfortran in resolve.c(resolve_branch) makes no distinction between
a block do construct and a nonblock do construct. The issue Harald raised
is jumping from some location inside the do-loop to a labeled end-do.
Before CYCLE, this was a common way to skip to the end of the loop. I'm
surprise that this hasn't come up before.
In playing around with various Do---ENDDO and IF---ENDIF constructs,
I've found that gfortran considerd ENDDO to be a part of its do block
and ENDIF is not part of its if block. I haven't read the standard
to determine if these are the correct semantics, but sure looks
weird to me.
troutmask:sgk[207] cat e.f90
program a
i = 1
goto 1
if (i == 1) then
i = i + 1
1 end if
goto 2
do i = 1, 3
j = i
2 end do
end program a
troutmask:sgk[208] gfortran43 -c e.f90
e.f90:12.1:
2 end do
1
e.f90:9.8:
goto 2
2
Warning: Label at (1) is not in the same block as the GOTO statement at (2)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38507
More information about the Gcc-bugs
mailing list