aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-02-19 18:05:31 +0100
committerTobias Burnus <tobias@codesourcery.com>2021-02-19 18:05:31 +0100
commit72d91d6cd41f2987339a98c2c64f70b3850f4e0b (patch)
treefd23da04ce55950d8ea9001cacf38555be37c2d3 /gcc/fortran
parentc8d13835638ff82f3ba7bfb0a5c2f597851dfb5a (diff)
downloadgcc-72d91d6cd41f2987339a98c2c64f70b3850f4e0b.zip
gcc-72d91d6cd41f2987339a98c2c64f70b3850f4e0b.tar.gz
gcc-72d91d6cd41f2987339a98c2c64f70b3850f4e0b.tar.bz2
Fortran: Fix DTIO with type ICE [PR99146]
gcc/fortran/ChangeLog: PR fortran/99146 * interface.c: gcc/testsuite/ChangeLog: PR fortran/99146 * gfortran.dg/dtio_36.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/interface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 87fe142..f7ca52e 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -5305,7 +5305,9 @@ gfc_find_specific_dtio_proc (gfc_symbol *derived, bool write, bool formatted)
}
finish:
- if (dtio_sub && derived != CLASS_DATA (dtio_sub->formal->sym)->ts.u.derived)
+ if (dtio_sub
+ && dtio_sub->formal->sym->ts.type == BT_CLASS
+ && derived != CLASS_DATA (dtio_sub->formal->sym)->ts.u.derived)
gfc_find_derived_vtab (derived);
return dtio_sub;