* trans-common.c (find_equivalence): Find multiple rules.
testsuite/
* gfortran.fortran-torture/execute/equiv_1.f90: New test.
From-SVN: r82411
+2004-05-29 Paul Brook <paul@codesourcery.com>
+
+ * trans-common.c (find_equivalence): Find multiple rules.
+
2004-05-27 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.h (gfc_current_locus, gfc_set_locus): Remove.
/* Given a segment element, search through the equivalence lists for unused
- conditions that involve the symbol. Add these rules to the segment. */
+ conditions that involve the symbol. Add these rules to the segment. Only
+ checks for rules involving the first symbol in the equivalence set. */
static bool
find_equivalence (segment_info *f)
if (l->used)
continue;
- if (c->expr->symtree->n.sym ==f-> sym)
+ if (c->expr->symtree->n.sym == f-> sym)
{
eq = c;
other = l;
if (eq)
{
add_condition (f, eq, other);
- l->used = 1;
+ eq->used = 1;
found = TRUE;
- break;
+ /* If this symbol is the fist in the chain we may find other
+ matches. Otherwise we can skip to the next equivalence. */
+ if (eq == l)
+ break;
}
}
}
+2004-05-29 Paul Brook <paul@codesourcery.com>
+
+ * gfortran.fortran-torture/execute/equiv_1.f90: New test.
+
2004-05-28 Ziemowit Laski <zlaski@apple.com>
* gcc.dg/altivec-16.c: New test.
--- /dev/null
+program prog
+ common /block/ i
+ equivalence (a, b, c), (i, j, k ,l)
+ a = 1.0
+ b = 2.0
+ c = 3.0
+ i = 1
+ j = 2
+ k = 3
+ l = 4
+
+ if ((a .ne. 3.0) .or. (b .ne. 3.0) .or. (c .ne. 3.0)) call abort ()
+ if ((i .ne. 4) .or. (j .ne. 4) .or. (k .ne. 4) .or. (l .ne. 4)) &
+ call abort ()
+end program