From 0a8949a3f248a7b77e7c952bdfeff5649d25f8fd Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Tue, 30 Oct 2018 23:04:10 +0000 Subject: re PR fortran/85896 (ICE in gfc_convert_constant(): Unexpected type) 2018-10-30 Thomas Koenig PR fortran/85896 * simplify.c (simplify_min_max): Do not convert the type of the return expression. 2018-10-30 Thomas Koenig PR fortran/85896 * gfortran.dg/min_max_type.f90: New test. From-SVN: r265649 --- gcc/fortran/simplify.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'gcc/fortran/simplify.c') diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 3939d26..2c87ae9 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -4961,11 +4961,9 @@ static gfc_expr * simplify_min_max (gfc_expr *expr, int sign) { gfc_actual_arglist *arg, *last, *extremum; - gfc_intrinsic_sym * specific; last = NULL; extremum = NULL; - specific = expr->value.function.isym; arg = expr->value.function.actual; @@ -4995,15 +4993,6 @@ simplify_min_max (gfc_expr *expr, int sign) if (expr->value.function.actual->next != NULL) return NULL; - /* Convert to the correct type and kind. */ - if (expr->ts.type != BT_UNKNOWN) - return gfc_convert_constant (expr->value.function.actual->expr, - expr->ts.type, expr->ts.kind); - - if (specific->ts.type != BT_UNKNOWN) - return gfc_convert_constant (expr->value.function.actual->expr, - specific->ts.type, specific->ts.kind); - return gfc_copy_expr (expr->value.function.actual->expr); } -- cgit v1.1