This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR 30146, errors for INTENT(OUT) and INTENT(INOUT) for DO loop variables
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 01 Nov 2012 14:50:33 +0100
- Subject: Re: [patch, fortran] PR 30146, errors for INTENT(OUT) and INTENT(INOUT) for DO loop variables
- References: <509271EA.2040003@netcologne.de> <50927378.7020009@physik.uni-muenchen.de>
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