@@ -4147,10 +4147,7 @@ gfc_conv_intrinsic_minmax (gfc_se * se, gfc_expr * expr, enum tree_code op)
build_empty_stmt (input_location));
gfc_add_expr_to_block (&se->pre, tmp);
}
- if (TREE_CODE (type) == INTEGER_TYPE)
- se->expr = fold_build1_loc (input_location, FIX_TRUNC_EXPR, type, mvar);
- else
- se->expr = convert (type, mvar);
+ se->expr = convert (type, mvar);
}
new file mode 100644
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! { dg-options "-std=gnu" }
+! PR fortran/100283
+
+subroutine s ()
+ integer(kind=8) :: i,j,k
+ i = min0 (j,k)
+ i = max0 (-127_8, min0 (j,127_8))
+end subroutine s
new file mode 100644
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-fdefault-integer-8 -std=gnu" }
+! PR fortran/101123
+
+SUBROUTINE TEST
+ IMPLICIT INTEGER*4 (I-N)
+ MAXMN=MAX0(M,N)
+ MINMN=MIN0(M,0_4)
+ MAXRS=MAX1(R,S)
+END SUBROUTINE TEST