From 875c29a245150b6d023b8b0eb7f0ba224df082d0 Mon Sep 17 00:00:00 2001 From: Mark Eggleston Date: Thu, 1 Oct 2020 11:14:09 +0100 Subject: Fortran : ICE in gfc_validate_kind PR96099 Only check for kind if the type supports kind. 2020-10-12 Mark Eggleston gcc/fortran/ChangeLog: PR fortran/96099 * decl.c (gfc_match_implicit): Check for numeric and logical types. 2020-10-12 Mark Eggleston gcc/testsuite/ChangeLog: PR fortran/96099 * gfortran.dg/pr96099_1.f90: New test. * gfortran.dg/pr96099_2.f90: New test. --- gcc/fortran/decl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/decl.c') diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 326e6f5..bddf69c 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -4835,7 +4835,7 @@ gfc_match_implicit (void) /* Last chance -- check (). */ if (ts.type == BT_CHARACTER) m = gfc_match_char_spec (&ts); - else if (ts.type != BT_DERIVED) + else if (gfc_numeric_ts(&ts) || ts.type == BT_LOGICAL) { m = gfc_match_kind_spec (&ts, false); if (m == MATCH_NO) -- cgit v1.1