[patch, fortran] PR 30146, errors for INTENT(OUT) and INTENT(INOUT) for DO loop variables

Thomas Koenig tkoenig@netcologne.de
Thu Nov 1 13:50:00 GMT 2012


Hi Tobias,

>
> Hi Thomas,
>
> there are already lots of places that check for do variables,
> gfc_check_do_variable() does the hard work.

gfc_check_do_uses gfc_state_stack, which is built up (and
destroyed) during parsing.  This is too early because we
need to have the formal arglists resolved before we can
do the checks.

> Couldn't the same result be
> achieved in a much simpler way during resolution?

We would have to do the same work, building up a stack
of DO loops, during resolution.  I don't think there is
an advantage in simplicity doing this in resolution;
we would also have to make sure that the subroutine calls
within the DO loops and the loop variables are  resolved before
doing the check on the INTENT.

Regards

	Thomas



More information about the Fortran mailing list