------- Comment #7 from burnus at gcc dot gnu dot org 2010-07-22 06:44 ------- > (In reply to comment #5) > > I have now asked at
Seemingly, I break the dependency chain in comment 3; thus, only with an added "TARGET" in the module variable declaration and with an assumed-shaped dummy in "bar" the program is valid. Therefore: Ignore comment 4 and 5 - we are back to the code in comment 2. I think the patch below looks fine, however, if I set a break point, the function "gfc_check_dependency" is never called for test program. Thus, there must be at least another spot where a change is required. Paul, do you have an idea where? --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -807,6 +807,19 @@ gfc_check_dependency (gfc_expr *expr1, gfc_expr *expr2, bool identical) return 1; } + else + { + gfc_symbol *sym1 = expr1->symtree->n.sym; + gfc_symbol *sym2 = expr2->symtree->n.sym; + if (sym1->attr.target && sym2->attr.target + && ((sym1->attr.dummy && !sym1->attr.contiguous + && (!sym1->attr.dimension + || sym2->as->type == AS_ASSUMED_SHAPE)) + ||(sym2->attr.dummy && !sym2->attr.contiguous + && (!sym2->attr.dimension + || sym2->as->type == AS_ASSUMED_SHAPE)))) + return 1; + } /* Otherwise distinct symbols have no dependencies. */ return 0; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45019