From c9942e5faee857bdb4a5cdb6b9c16ea5cc59c542 Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Sun, 8 Dec 2019 12:25:15 +0000 Subject: re PR fortran/92755 (ICE in gfc_dep_resolver, at fortran/dependency.c:2123) 2019-12-08 Thomas Koenig PR fortran/92755 * dependency.c (gfc_dep_resolver): Move skipping of _data ref into the loop. 2019-12-08 Thomas Koenig PR fortran/92755 * gfortran.dg/dependency_57.f90: New test. From-SVN: r279086 --- gcc/fortran/dependency.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'gcc/fortran/dependency.c') diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index 02e4b4f..394d85b 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -2098,18 +2098,6 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse, gfc_dependency this_dep; bool same_component = false; - /* The refs might come in mixed, one with a _data component and one - without. Look at their next reference in order to avoid an - ICE. */ - - if (lref && lref->type == REF_COMPONENT && lref->u.c.component - && strcmp (lref->u.c.component->name, "_data") == 0) - lref = lref->next; - - if (rref && rref->type == REF_COMPONENT && rref->u.c.component - && strcmp (rref->u.c.component->name, "_data") == 0) - rref = rref->next; - this_dep = GFC_DEP_ERROR; fin_dep = GFC_DEP_ERROR; /* Dependencies due to pointers should already have been identified. @@ -2117,6 +2105,18 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse, while (lref && rref) { + /* The refs might come in mixed, one with a _data component and one + without. Look at their next reference in order to avoid an + ICE. */ + + if (lref && lref->type == REF_COMPONENT && lref->u.c.component + && strcmp (lref->u.c.component->name, "_data") == 0) + lref = lref->next; + + if (rref && rref->type == REF_COMPONENT && rref->u.c.component + && strcmp (rref->u.c.component->name, "_data") == 0) + rref = rref->next; + /* We're resolving from the same base symbol, so both refs should be the same type. We traverse the reference chain until we find ranges that are not equal. */ -- cgit v1.1