aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-common.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-02-24 10:51:42 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-02-24 10:51:42 +0000
commit8a0b57b3c7a133c91bb9375635909472749ca954 (patch)
treedc27777b618a359e0083f3498fafe574f05d1710 /gcc/fortran/trans-common.c
parent8097c268b057a760157ee16d3bd6ec436f7e5cfe (diff)
downloadgcc-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/trans-common.c')
-rw-r--r--gcc/fortran/trans-common.c20
1 files changed, 14 insertions, 6 deletions
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;
+ }
}
}
}