summaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-18 11:03:41 +0000
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-18 11:03:41 +0000
commitded32fb5ac5c49bda4df4b21c8673e4a8b26fd1a (patch)
tree610ec5bf1dbceb85fb2160fc5250ebdadbf9d45a /gcc/fortran/interface.c
parent856bd6f2e80ac39eb19b9eb9440e1fdd5aa2ce58 (diff)
downloadgcc-ded32fb5ac5c49bda4df4b21c8673e4a8b26fd1a.tar.gz
2016-12-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/78592 * interfac.c (gfc_find_specific_dtio_proc): Fixup for r243005, making sure that the generic list is followed through until the end. 2016-12-18 Janus Weil <janus@gcc.gnu.org> PR fortran/78592 * gfortran.dg/dtio_21.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243783 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 6e61aec1d01..6264aba3916 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -4949,17 +4949,19 @@ gfc_find_specific_dtio_proc (gfc_symbol *derived, bool write, bool formatted)
&& tb_io_st->n.sym->generic)
{
for (gfc_interface *intr = tb_io_st->n.sym->generic;
- intr && intr->sym && intr->sym->formal;
- intr = intr->next)
+ intr && intr->sym; intr = intr->next)
{
- gfc_symbol *fsym = intr->sym->formal->sym;
- if ((fsym->ts.type == BT_CLASS
- && CLASS_DATA (fsym)->ts.u.derived == extended)
- || (fsym->ts.type == BT_DERIVED
- && fsym->ts.u.derived == extended))
+ if (intr->sym->formal)
{
- dtio_sub = intr->sym;
- break;
+ gfc_symbol *fsym = intr->sym->formal->sym;
+ if ((fsym->ts.type == BT_CLASS
+ && CLASS_DATA (fsym)->ts.u.derived == extended)
+ || (fsym->ts.type == BT_DERIVED
+ && fsym->ts.u.derived == extended))
+ {
+ dtio_sub = intr->sym;
+ break;
+ }
}
}
}