+2017-12-09 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/83316
+ * arith.c (gfc_character2character): New function.
+ * arith.h: Add prototype.
+ * simplify.c (gfc_convert_constant): Handle character type.
+
2017-12-07 Martin Sebor <msebor@redhat.com>
PR c/81544
return result;
}
+/* Convert character to character. We only use wide strings internally,
+ so we only set the kind. */
+
+gfc_expr *
+gfc_character2character (gfc_expr *src, int kind)
+{
+ gfc_expr *result;
+ result = gfc_copy_expr (src);
+ result->ts.kind = kind;
+
+ return result;
+}
/* Helper function to set the representation in a Hollerith conversion.
This assumes that the ts.type and ts.kind of the result have already
gfc_expr *gfc_hollerith2complex (gfc_expr *, int);
gfc_expr *gfc_hollerith2character (gfc_expr *, int);
gfc_expr *gfc_hollerith2logical (gfc_expr *, int);
+gfc_expr *gfc_character2character (gfc_expr *, int);
#endif /* GFC_ARITH_H */
}
break;
+ case BT_CHARACTER:
+ if (type == BT_CHARACTER)
+ f = gfc_character2character;
+ else
+ goto oops;
+ break;
+
default:
oops:
gfc_internal_error ("gfc_convert_constant(): Unexpected type");
+2017-12-09 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/83316
+ * gfortran.dg/minval_char_5.f90: New test.
+
2017-12-08 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/83317
--- /dev/null
+! { dg-do run }
+! PR fortran/83316 - this used to ICE
+program tminmaxval
+ implicit none
+
+ character(len=*), parameter :: b = "a"
+ character(len=*), parameter :: e = "c"
+ character(len=*), parameter :: s(3) = (/"a", "b", "c"/)
+
+ if (minval(s) /= b) then
+ call abort
+ end if
+
+ if (maxval(s) /= e) then
+ call abort
+ end if
+
+end program tminmaxval