aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.cc
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2022-01-23 21:55:33 +0100
committerHarald Anlauf <anlauf@gmx.de>2022-01-27 20:37:02 +0100
commitb51fb28ed294cdf19087ca9d9ad107c9c52bec42 (patch)
tree9adae9321156b5bccb8c7b1e8508b8d04dc912d7 /gcc/fortran/expr.cc
parentfd59d5d4a2ef8a97541a22399480bc1f8e82ceca (diff)
downloadgcc-b51fb28ed294cdf19087ca9d9ad107c9c52bec42.zip
gcc-b51fb28ed294cdf19087ca9d9ad107c9c52bec42.tar.gz
gcc-b51fb28ed294cdf19087ca9d9ad107c9c52bec42.tar.bz2
Fortran: fix issues with internal conversion between default and wide char
gcc/fortran/ChangeLog: PR fortran/104128 * expr.cc (gfc_copy_expr): Convert internal representation of string to wide char in value only for default character kind. * target-memory.cc (interpret_array): Pass flag for conversion of wide chars. (gfc_target_interpret_expr): Likewise. gcc/testsuite/ChangeLog: PR fortran/104128 * gfortran.dg/transfer_simplify_14.f90: New test.
Diffstat (limited to 'gcc/fortran/expr.cc')
-rw-r--r--gcc/fortran/expr.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index 279d9b3..ed82a94 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -312,7 +312,8 @@ gfc_copy_expr (gfc_expr *p)
break;
case BT_CHARACTER:
- if (p->representation.string)
+ if (p->representation.string
+ && p->ts.kind == gfc_default_character_kind)
q->value.character.string
= gfc_char_to_widechar (q->representation.string);
else