Dear Thomas, I am sorry for the long silence on this PR. I have been up to my eyeballs in daytime work.
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. Cheers Paul On Sun, May 22, 2011 at 5:32 PM, Thomas Koenig <tkoe...@netcologne.de> wrote: > Hello world, > > the attached patch fixes PR 48955, a wrong-code regression for 4.6 and 4.7, > including the test case from > http://gcc.gnu.org/ml/fortran/2011-05/msg00093.html . It follows the > outline from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48955#c7 . > > Regression-tested. OK for trunk? > > Thomas > > 2011-05-22 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/48955 > * gfortran.h (gfc_reverse): Change to struct with two boolean > variables, forward_ok and backward_ok. > * trans-expr.c (gfc_trans_assignment_1): Initialize using > new gfc_reverse struct. > * trans-array.c (gfc_init_loopinfo): Likewise. > (gfc_trans_scalarized_loop): Use new gfc_reverse. > * dependency.c (gfc_dep_resovler): Use new gfc_reverse. > If a forward dependency is found, a backward dependency is > no longer possible and vice versa. > > 2011-05-22 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/48955 > * gfortran.dg/dependency_40.f90: New test. > > -- The knack of flying is learning how to throw yourself at the ground and miss. --Hitchhikers Guide to the Galaxy