aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2017-12-09 08:37:17 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2017-12-09 08:37:17 +0000
commitb01fff4882f0c5d35a52e7001832e31c708fffd9 (patch)
tree25ee205b4dca5402eabeed57e569d5310926452a /gcc/fortran/arith.c
parent3a4c600f389e8c5aa6dcbd6cd14bd0c546af0bb2 (diff)
downloadgcc-b01fff4882f0c5d35a52e7001832e31c708fffd9.zip
gcc-b01fff4882f0c5d35a52e7001832e31c708fffd9.tar.gz
gcc-b01fff4882f0c5d35a52e7001832e31c708fffd9.tar.bz2
re PR fortran/83316 (ICE: minval/maxval and characters)
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-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/83316 * gfortran.dg/minval_char_5.f90: New test. From-SVN: r255522
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 3c75895..2673067 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -2514,6 +2514,18 @@ gfc_int2log (gfc_expr *src, int kind)
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