[Bug fortran/50122] Same labels in nested scoping units rejected
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 19 06:16:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50122
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |burnus at gcc dot gnu.org
Resolution| |INVALID
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-19 06:04:44 UTC ---
While it is accepted by the Cray ftn compiler,
http://j3-fortran.org/pipermail/j3/2011-August/004587.html
is looks ambiguous which GOTO should be executed.
Thus, not surprisingly, it is invalid as the standard seems to avoids resolving
ambiguity by prioritizing the order.
I think Malcolm is right by stating the following:
http://j3-fortran.org/pipermail/j3/2011-August/004593.html
> > "The same statement label shall not be given to more than one statement
> > in its scope." (F2008, "3.2.5 Statement labels")
>
> The scope of a label is an inclusive scope. The very text you quoted tells us
> that the inclusive scope includes both of those statements so you have not
> obeyed the rules.
[...]
> We carefully worded this not to say scoping unit but scope precisely
> to get this effect!
(For more F2008 quotes, see Malcolm's email and my initial J3 email (cf. bottom
of comment 0).)
As I concur with this analysis and as gfortran already rejects the code with
"duplicate statement label", I closed now the PR as INVALID.
More information about the Gcc-bugs
mailing list