[gortran, PATCH] Fix PR 18937

Toon Moene toon@moene.indiv.nluug.nl
Mon Mar 26 19:47:00 GMT 2007


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



More information about the Gcc-patches mailing list