aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.cc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-10-19 15:25:12 +0200
committerMartin Liska <mliska@suse.cz>2022-10-19 15:25:12 +0200
commit4465e2a047c3b175bf6c4ca500547eb6b12df52f (patch)
tree3159c8256f9907538f186ce7c1087c83825b5519 /gcc/fortran/trans-expr.cc
parent6c22519f33270a689fc8730ceff9212b376ed40d (diff)
parent09fed44cabd50f3d8e050f91cc2db02364ce9176 (diff)
downloadgcc-4465e2a047c3b175bf6c4ca500547eb6b12df52f.zip
gcc-4465e2a047c3b175bf6c4ca500547eb6b12df52f.tar.gz
gcc-4465e2a047c3b175bf6c4ca500547eb6b12df52f.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
-rw-r--r--gcc/fortran/trans-expr.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 1551a2e..e7b9211 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -10374,15 +10374,15 @@ gfc_conv_string_parameter (gfc_se * se)
|| TREE_CODE (TREE_TYPE (se->expr)) == INTEGER_TYPE)
&& TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
{
+ type = TREE_TYPE (se->expr);
if (TREE_CODE (se->expr) != INDIRECT_REF)
- {
- type = TREE_TYPE (se->expr);
- se->expr = gfc_build_addr_expr (build_pointer_type (type), se->expr);
- }
+ se->expr = gfc_build_addr_expr (build_pointer_type (type), se->expr);
else
{
- type = gfc_get_character_type_len (gfc_default_character_kind,
- se->string_length);
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
+ type = gfc_get_character_type_len_for_eltype (type,
+ se->string_length);
type = build_pointer_type (type);
se->expr = gfc_build_addr_expr (type, se->expr);
}