aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2016-12-18 12:03:41 +0100
committerJanus Weil <janus@gcc.gnu.org>2016-12-18 12:03:41 +0100
commit413e859cdf69f402e64da550f6513021eb173fdc (patch)
tree610ec5bf1dbceb85fb2160fc5250ebdadbf9d45a /gcc/fortran/interface.c
parentab5d223376e8ef78ee7d5266cae80a9587ffb80e (diff)
downloadgcc-413e859cdf69f402e64da550f6513021eb173fdc.zip
gcc-413e859cdf69f402e64da550f6513021eb173fdc.tar.gz
gcc-413e859cdf69f402e64da550f6513021eb173fdc.tar.bz2
re PR fortran/78592 (ICE in gfc_find_specific_dtio_proc, at fortran/interface.c:4939)
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. From-SVN: r243783
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 6e61aec..6264aba 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;
+ }
}
}
}