From e1b7f42ec66b9a00db2b30f1e00b707bbad9f452 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 2 Dec 2014 08:50:57 +0000 Subject: [PATCH] re PR fortran/64137 (Fortran FE builds invalid GENERIC) 2014-12-02 Richard Biener PR fortran/64137 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Check proper expressions type, use proper type for computing -Huge - 1. From-SVN: r218259 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/trans-intrinsic.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index db8b5cdf5b7..4bf21edef60 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2014-12-02 Richard Biener + + PR fortran/64137 + * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Check + proper expressions type, use proper type for computing + -Huge - 1. + 2014-11-29 Jakub Jelinek * trans-openmp.c (gfc_omp_finish_clause, diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index c13502e5a4e..d5972077940 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -3729,9 +3729,9 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) possible value is HUGE in both cases. */ if (op == GT_EXPR) tmp = fold_build1_loc (input_location, NEGATE_EXPR, TREE_TYPE (tmp), tmp); - if (op == GT_EXPR && expr->ts.type == BT_INTEGER) + if (op == GT_EXPR && arrayexpr->ts.type == BT_INTEGER) tmp = fold_build2_loc (input_location, MINUS_EXPR, TREE_TYPE (tmp), tmp, - build_int_cst (type, 1)); + build_int_cst (TREE_TYPE (tmp), 1)); gfc_add_modify (&se->pre, limit, tmp); -- 2.30.2