Dear All, > > I have posted a simpler alternative on the PR that uses your > suggestion that forward and backward dependences need to to be > recorded to get this right. > > I believe that it's OK but have only now had the opportunity to put it > on to regtest. > Following some comments from Thomas, the attached is the version that I wound up with. Tell us which one you prefer and Thomas and I will do the honours. Bootstrapped and regtested on FC9/x86_64 - OK for trunk and 4.6? Paul 2011-05-24 Paul Thomas Thomas Koenig PR fortran/48955 * trans-expr.c (gfc_trans_assignment_1): GFC_REVERSE_NOT_SET changed to GFC_ENABLE_REVERSE. * trans-array.c (gfc_init_loopinfo): GFC_CANNOT_REVERSE changed to GFC_INHIBIT_REVERSE. * gfortran.h : Enum gfc_reverse is now GFC_ENABLE_REVERSE, GFC_FORWARD_SET, GFC_REVERSE_SET and GFC_INHIBIT_REVERSE. * dependency.c (gfc_dep_resolver): Change names for elements of gfc_reverse as necessary. Change the logic so that forward dependences are remembered as well as backward ones. When both have appeared, force a temporary. 2011-05-24 Thomas Koenig PR fortran/48955 * gfortran.dg/dependency_40.f90 : New test.