diff options
| author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-29 01:21:51 +0000 |
|---|---|---|
| committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-29 01:21:51 +0000 |
| commit | 03500d571a1d8299eef6234c2496cf09c85ca47c (patch) | |
| tree | 247774f94be446e16946bbb9f3c16c77c9b72c15 /gcc/fortran/trans-common.c | |
| parent | 696c9531ed7acc28aca8cded71763618ffd47ce3 (diff) | |
| download | ppe42-gcc-03500d571a1d8299eef6234c2496cf09c85ca47c.tar.gz ppe42-gcc-03500d571a1d8299eef6234c2496cf09c85ca47c.zip | |
* trans-common.c (find_equivalence): Find multiple rules.
testsuite/
* gfortran.fortran-torture/execute/equiv_1.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82411 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-common.c')
| -rw-r--r-- | gcc/fortran/trans-common.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 458dbeff368..74842847307 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; } } } |

