diff options
author | Paul Brook <paul@codesourcery.com> | 2004-05-29 01:21:51 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2004-05-29 01:21:51 +0000 |
commit | 353c3b7e16645aa9e2be04e80707e256965642e4 (patch) | |
tree | 247774f94be446e16946bbb9f3c16c77c9b72c15 /gcc/fortran | |
parent | b1243dd57bc4692e15fa8eaa8e6e566aaa65d289 (diff) | |
download | gcc-353c3b7e16645aa9e2be04e80707e256965642e4.zip gcc-353c3b7e16645aa9e2be04e80707e256965642e4.tar.gz gcc-353c3b7e16645aa9e2be04e80707e256965642e4.tar.bz2 |
trans-common.c (find_equivalence): Find multiple rules.
* trans-common.c (find_equivalence): Find multiple rules.
testsuite/
* gfortran.fortran-torture/execute/equiv_1.f90: New test.
From-SVN: r82411
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/trans-common.c | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 69fa1f5..786cc39 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +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. diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 458dbef..7484284 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -649,7 +649,8 @@ add_condition (segment_info *f, gfc_equiv *eq1, gfc_equiv *eq2) /* 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) @@ -666,7 +667,7 @@ 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; @@ -682,9 +683,12 @@ find_equivalence (segment_info *f) 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; } } } |