diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-02-24 10:51:42 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-02-24 10:51:42 +0000 |
commit | 8a0b57b3c7a133c91bb9375635909472749ca954 (patch) | |
tree | dc27777b618a359e0083f3498fafe574f05d1710 /gcc/fortran | |
parent | 8097c268b057a760157ee16d3bd6ec436f7e5cfe (diff) | |
download | gcc-8a0b57b3c7a133c91bb9375635909472749ca954.zip gcc-8a0b57b3c7a133c91bb9375635909472749ca954.tar.gz gcc-8a0b57b3c7a133c91bb9375635909472749ca954.tar.bz2 |
re PR fortran/24519 (gfortran slow because of incomplete dependency checking)
2006-02-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24519
* dependency.c (gfc_is_same_range): Correct typo.
(gfc_check_section_vs_section): Call gfc_is_same_range.
PR fortran/25395
* trans-common.c (add_equivalences): Add a new flag that is set when
an equivalence is seen that prevents more from being reset until the
start of a new traversal of the list, thus ensuring completion of
all the equivalences.
2006-02-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24519
* gfortran.dg/dependency_3.f90: New test.
* gfortran.fortran-torture/execute/vect-3.f90: Remove two of the
XFAILs.
PR fortran/25395
* gfortran.dg/equiv_6.f90: New test.
From-SVN: r111416
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/fortran/dependency.c | 12 | ||||
-rw-r--r-- | gcc/fortran/trans-common.c | 20 |
3 files changed, 34 insertions, 10 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d78819f..f000725 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,15 @@ +2006-02-24 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/24519 + * dependency.c (gfc_is_same_range): Correct typo. + (gfc_check_section_vs_section): Call gfc_is_same_range. + + PR fortran/25395 + * trans-common.c (add_equivalences): Add a new flag that is set when + an equivalence is seen that prevents more from being reset until the + start of a new traversal of the list, thus ensuring completion of + all the equivalences. + 2006-02-23 Erik Edelmann <eedelman@gcc.gnu.org> * module.c (read_module): Remove redundant code lines. diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index 62f3aa6..df6609b 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -159,7 +159,7 @@ gfc_is_same_range (gfc_array_ref * ar1, gfc_array_ref * ar2, int n, int def) e1 = ar1->as->lower[n]; if (ar2->as && !e2) - e2 = ar2->as->upper[n]; + e2 = ar2->as->lower[n]; /* Check we have values for both. */ if (!(e1 && e2)) @@ -538,15 +538,19 @@ gfc_check_section_vs_section (gfc_ref * lref, gfc_ref * rref, int n) gfc_expr *r_start; gfc_expr *r_stride; - gfc_array_ref l_ar; - gfc_array_ref r_ar; + gfc_array_ref l_ar; + gfc_array_ref r_ar; mpz_t no_of_elements; - mpz_t X1, X2; + mpz_t X1, X2; gfc_dependency dep; l_ar = lref->u.ar; r_ar = rref->u.ar; + + /* If they are the same range, return without more ado. */ + if (gfc_is_same_range (&l_ar, &r_ar, n, 0)) + return GFC_DEP_EQUAL; l_start = l_ar.start[n]; l_end = l_ar.end[n]; diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index f819b34..5d72a50 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -755,15 +755,20 @@ find_equivalence (segment_info *n) } -/* Add all symbols equivalenced within a segment. We need to scan the - segment list multiple times to include indirect equivalences. */ + /* Add all symbols equivalenced within a segment. We need to scan the + segment list multiple times to include indirect equivalences. Since + a new segment_info can inserted at the beginning of the segment list, + depending on its offset, we have to force a final pass through the + loop by demanding that completion sees a pass with no matches; ie. + all symbols with equiv_built set and no new equivalences found. */ static void add_equivalences (bool *saw_equiv) { segment_info *f; - bool more; + bool seen_one, more; + seen_one = false; more = TRUE; while (more) { @@ -773,9 +778,12 @@ add_equivalences (bool *saw_equiv) if (!f->sym->equiv_built) { f->sym->equiv_built = 1; - more = find_equivalence (f); - if (more) - *saw_equiv = true; + seen_one = find_equivalence (f); + if (seen_one) + { + *saw_equiv = true; + more = true; + } } } } |