From f48bffe70cba310461ec19ffcd07c573a6b86575 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 25 Jun 2020 16:57:08 +0200 Subject: Fortran: Fix character-kind=4 substring resolution (PR95837) Testing showed that it is always set and its value matches always ts->kind (if available) or otherwise, if it is a variable, the sym->ts.kind. gcc/fortran/ChangeLog: PR fortran/95837 * resolve.c (gfc_resolve_substring_charlen): Remove bogus ts.kind setting for the expression. gcc/testsuite/ChangeLog: PR fortran/95837 * gfortran.dg/char4-subscript.f90: New test. --- gcc/fortran/resolve.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index c53b312..8c602da 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -5140,9 +5140,6 @@ gfc_resolve_substring_charlen (gfc_expr *e) return; } - e->ts.type = BT_CHARACTER; - e->ts.kind = gfc_default_character_kind; - if (!e->ts.u.cl) e->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); -- cgit v1.1