This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]