This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Fix PR64137
- From: Richard Biener <rguenther at suse dot de>
- To: FX <fxcoudert at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 1 Dec 2014 16:41:10 +0100 (CET)
- Subject: Re: [PATCH] Fix PR64137
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1412011443480 dot 5894 at zhemvz dot fhfr dot qr> <794D914F-7271-4E1E-A767-613E16082044 at gmail dot com>
On Mon, 1 Dec 2014, FX wrote:
> Your change is OK (we donât want to use the type of the result, but the type of the argument indeed).
>
>
> > Index: gcc/fortran/trans-intrinsic.c
> > ===================================================================
> > --- gcc/fortran/trans-intrinsic.c (revision 218211)
> > +++ gcc/fortran/trans-intrinsic.c (working copy)
> > @@ -3729,7 +3729,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * s
> > 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));
>
>
> Logic would dictate that it is "build_int_cst (TREE_TYPE (tmp), 1)â
> instead of "build_int_cst (type, 1)â in that last line. Probably doesnât
> matter much, as it will be all folded into the same value anyway, but
> could you test and commit that change together, while youâre at it?
Sure, will re-test and commit tomorrow.
Thanks,
Richard.