https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64137
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2014-12-01 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- 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)); works for me. So I suppose this is a wrong-code bug as we shouldn't have subtracted 1 off -Huge (what's that anyway?) But then is "integer -Huge" C INT_MIN + 1? Anyway, testing the above.