summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-24 10:51:42 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-24 10:51:42 +0000
commit477c2f8751efea5fa8a283d3a0faec5115175282 (patch)
treedc27777b618a359e0083f3498fafe574f05d1710 /gcc/fortran
parent1d15adaa22a1f772c0485675970a5468b37ca3ab (diff)
downloadgcc-477c2f8751efea5fa8a283d3a0faec5115175282.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111416 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog12
-rw-r--r--gcc/fortran/dependency.c12
-rw-r--r--gcc/fortran/trans-common.c20
3 files changed, 34 insertions, 10 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d78819f92e4..f00072509bb 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 62f3aa62e48..df6609bf949 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 f819b342cf6..5d72a5086bc 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;
+ }
}
}
}