aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-expr.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 71b1ffa..4463ecd 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-02 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/58593
+ * trans-expr.c (gfc_conv_string_tmp): Fix obtaining
+ the byte size of a single character.
+
2013-10-01 Tobias Burnus <burnus@net-b.de>
PR fortran/58579
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 67c8045..a590ca1 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2357,8 +2357,9 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
var = gfc_create_var (type, "pstr");
gcc_assert (POINTER_TYPE_P (type));
tmp = TREE_TYPE (type);
- gcc_assert (TREE_CODE (tmp) == ARRAY_TYPE);
- tmp = TYPE_SIZE_UNIT (TREE_TYPE (tmp));
+ if (TREE_CODE (tmp) == ARRAY_TYPE)
+ tmp = TREE_TYPE (tmp);
+ tmp = TYPE_SIZE_UNIT (tmp);
tmp = fold_build2_loc (input_location, MULT_EXPR, size_type_node,
fold_convert (size_type_node, len),
fold_convert (size_type_node, tmp));