From e9b75848c387d7c40ae8099b29f76bf473feb728 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Sun, 16 Dec 2018 16:29:43 +0000 Subject: re PR fortran/88116 (ICE in gfc_convert_constant(): Unexpected type) 2018-12-16 Steven G. Kargl PR fortran/88116 PR fortran/88467 * array.c (gfc_match_array_constructor): Check return value of gfc_convert_type(). Skip constructor elements with BT_UNKNOWN, which need to go through resolution. * intrinsic.c (gfc_convert_type_warn): Return early if the types martch (i.e., no conversion is required). * simplify.c (gfc_convert_constant): Remove a gfc_internal_error, and return gfc_bad_expr. 2018-12-16 Steven G. Kargl PR fortran/88116 * gfortran.dg/pr88116_1.f90: New test. * gfortran.dg/pr88116_2.f90: Ditto. PR fortran/88467 * gfortran.dg/pr88467.f90: New test. From-SVN: r267189 --- gcc/fortran/array.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/array.c') diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index e4926d7..1c5af79 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1246,7 +1246,9 @@ done: { c = gfc_constructor_first (head); for (; c; c = gfc_constructor_next (c)) - gfc_convert_type (c->expr, &ts, 1); + if (!gfc_convert_type (c->expr, &ts, 1) + && c->expr->ts.type != BT_UNKNOWN) + return MATCH_ERROR; } } else -- cgit v1.1