From 14ee7de064f757c7677b906010f7e67e702b62c7 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Thu, 10 May 2018 22:45:38 +0000 Subject: re PR fortran/85521 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2049) 2018-05-10 Steven G. Kargl PR fortran/85521 * array.c (gfc_resolve_character_array_constructor): Substrings with upper bound smaller than lower bound are zero length strings. 2018-05-10 Steven G. Kargl PR fortran/85521 * gfortran.dg/pr85521_1.f90: New test. * gfortran.dg/pr85521_2.f90: New test. From-SVN: r260139 --- gcc/fortran/array.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/array.c') diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 58d611ba..052775f 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -2046,7 +2046,8 @@ got_charlen: else return true; - gcc_assert (current_length != -1); + if (current_length < 0) + current_length = 0; if (found_length == -1) found_length = current_length; -- cgit v1.1