aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2013-10-02 23:02:14 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2013-10-02 23:02:14 +0200
commit9c84da22d52e3cb52788950652ba136fe5cc1307 (patch)
tree64079c64b78c74abc8e50a1eac9edf341cb1cbad /gcc/fortran/trans-expr.c
parent44d209d7e2652a5a3a1eb8ee24d65edcebf13e7e (diff)
downloadgcc-9c84da22d52e3cb52788950652ba136fe5cc1307.zip
gcc-9c84da22d52e3cb52788950652ba136fe5cc1307.tar.gz
gcc-9c84da22d52e3cb52788950652ba136fe5cc1307.tar.bz2
re PR fortran/58593 (internal compiler error: in gfc_conv_string_tmp, at fortran/trans-expr.c:2360)
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-02 Tobias Burnus <burnus@net-b.de> PR fortran/58593 * gfortran.dg/char_length_19.f90: New. From-SVN: r203135
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c5
1 files changed, 3 insertions, 2 deletions
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));