From ca9275d8ab02436b45f25f155c510210f07fccb5 Mon Sep 17 00:00:00 2001 From: Mark Eggleston Date: Wed, 10 Jun 2020 16:18:23 +0100 Subject: Fortran : ICE in gfc_validate_kind PR95586 Report syntax error for invalid letter-spec in IMPLICIT statements for derived types and not an ICE. Original patch by Steve Kargl. Added test cases based on those provided by G. Steinmetz in the PR. 2020-06-23 Steven G. Kargl gcc/fortran/ PR fortran/95586 * decl.c (gfc_match_implicit): Only perform else branch if the type spect is not BT_DERIVED. 2020-06-23 Mark Eggleston gcc/testsuite/ PR fortran/95586 * gfortran.dg/pr95586_1.f90: New test. * gfortran.dg/pr95586_2.f90: New test. --- gcc/fortran/decl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index c8a9853..c27cfac 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -4827,7 +4827,7 @@ gfc_match_implicit (void) /* Last chance -- check (). */ if (ts.type == BT_CHARACTER) m = gfc_match_char_spec (&ts); - else + else if (ts.type != BT_DERIVED) { m = gfc_match_kind_spec (&ts, false); if (m == MATCH_NO) -- cgit v1.1