aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorFritz Reese <foreese@gcc.gnu.org>2020-04-06 16:14:29 -0400
committerFritz Reese <foreese@gcc.gnu.org>2020-04-06 16:17:07 -0400
commitd42a2e465d821517819a54f4f613bb6e6443dc05 (patch)
tree3052cae914d59825bb79bc922c5c1c2707b00330 /gcc/fortran/decl.c
parent130f703da0c0d7b785d394b17df884379b4aadd9 (diff)
downloadgcc-d42a2e465d821517819a54f4f613bb6e6443dc05.zip
gcc-d42a2e465d821517819a54f4f613bb6e6443dc05.tar.gz
gcc-d42a2e465d821517819a54f4f613bb6e6443dc05.tar.bz2
Fix fortran/93686 -- ICE matching data statements with derived-type pointers.
gcc/fortran/ChangeLog: 2020-04-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/93686 * decl.c (gfc_match_data): Handle data matching for derived type pointers. gcc/testsuite/ChangeLog: 2020-04-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/93686 * gfortran.dg/pr93686_1.f90: New test. * gfortran.dg/pr93686_2.f90: Likewise. * gfortran.dg/pr93686_3.f90: Likewise. * gfortran.dg/pr93686_4.f90: Likewise.
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ea30908..b3ed63c 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -696,6 +696,10 @@ gfc_match_data (void)
/* F2008:C567 (R536) A data-i-do-object or a variable that appears
as a data-stmt-object shall not be an object designator in which
a pointer appears other than as the entire rightmost part-ref. */
+ if (!e->ref && e->ts.type == BT_DERIVED
+ && e->symtree->n.sym->attr.pointer)
+ goto partref;
+
ref = e->ref;
if (e->symtree->n.sym->ts.type == BT_DERIVED
&& e->symtree->n.sym->attr.pointer