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 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 PR fortran/48955 * gfortran.dg/dependency_40.f90: New test.