diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-12-08 12:25:15 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-12-08 12:25:15 +0000 |
commit | c9942e5faee857bdb4a5cdb6b9c16ea5cc59c542 (patch) | |
tree | 4c51fe1fcd1e27f92538cde361f0fdd0185650af /gcc | |
parent | 9f5836a6927c18a18b5bfbdfd95eb2a5f4b834b2 (diff) | |
download | gcc-c9942e5faee857bdb4a5cdb6b9c16ea5cc59c542.zip gcc-c9942e5faee857bdb4a5cdb6b9c16ea5cc59c542.tar.gz gcc-c9942e5faee857bdb4a5cdb6b9c16ea5cc59c542.tar.bz2 |
re PR fortran/92755 (ICE in gfc_dep_resolver, at fortran/dependency.c:2123)
2019-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92755
* dependency.c (gfc_dep_resolver): Move skipping of _data ref
into the loop.
2019-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92755
* gfortran.dg/dependency_57.f90: New test.
From-SVN: r279086
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/dependency.c | 24 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/dependency_57.f90 | 12 |
4 files changed, 36 insertions, 13 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 080f92e..60114db 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-12-08 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/92755 + * dependency.c (gfc_dep_resolver): Move skipping of _data ref + into the loop. + 2019-12-07 Tobias Burnus <tobias@codesourcery.com> PR fortran/92793 @@ -28,7 +34,7 @@ 2019-12-06 Tobias Burnus <tobias@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com> - * trans-openmp.c (gfc_build_conditional_assign, + * trans-openmp.c (gfc_build_conditional_assign, gfc_build_conditional_assign_expr): New static functions. (gfc_omp_finish_clause, gfc_trans_omp_clauses): Handle mapping of absent optional arguments and fix mapping of present optional args. 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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c1b9542..6c28808 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-12-08 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/92755 + * gfortran.dg/dependency_57.f90: New test. + 2019-12-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * g++.dg/cpp0x/gen-attrs-36.C: Update expected diagnostics. diff --git a/gcc/testsuite/gfortran.dg/dependency_57.f90 b/gcc/testsuite/gfortran.dg/dependency_57.f90 new file mode 100644 index 0000000..fdf95b2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dependency_57.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! PR 92755 - this used to cause an ICE. +! Original test case by Gerhard Steinmetz +program p + type t + end type + type t2 + class(t), allocatable :: a(:) + end type + type(t2) :: z + z%a = [z%a] +end |