This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gortran, PATCH] Fix PR 18937
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, stevenb dot gcc at gmail dot com
- Date: Mon, 26 Mar 2007 20:49:05 +0200
- Subject: Re: [gortran, PATCH] Fix PR 18937
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <4606EB73.8080109@physik.uni-muenchen.de>
Tobias Schlüter wrote:
Of course, life is not as simple as one would hope: in order to
determine if a branch is valid we have to know if the branch target is
an END {DO,SELECT,IF} statement (can someone point me to the relevant
quote in the standard, I couldn't seem to find it.
Quoting the 2003 Standard:
IF statement (page 156-157):
An ELSE IF statement or an ELSE statement shall not be a branch target
statement. It is permissible to branch to an END IF statement only from
with its IF construct.
CASE statement (page 159):
A CASE statement shall not be a branch target statement. It is
permissible to branch to an [END SELECT statement] only from within its
CASE construct.
DO statement (page 167):
In a block DO construct, a transfer of control to the [END DO statement]
has the same effect as execution of a CYCLE statement belonging to that
construct.
(page 168):
(4) Transfer of control from a statement within the range of a DO
construct to a statement that is neither the [END DO statement]
nor within the range of the same DO construct [terminates the
loop].
I think I've got them all ...
Cheers,
--
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
At home: http://moene.indiv.nluug.nl/~toon/
Who's working on GNU Fortran:
http://gcc.gnu.org/ml/gcc/2007-01/msg00059.html