From: Paul Thomas Date: Fri, 5 Oct 2018 07:01:57 +0000 (+0000) Subject: re PR testsuite/87487 (New test case gfortran.dg/deferred_character_24.f90 in r264721... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3665f77c7f63737252fea0e153a6426aa1241a7a;p=gcc.git re PR testsuite/87487 (New test case gfortran.dg/deferred_character_24.f90 in r264721 fails on big endian) 2018-10-05 Paul Thomas PR fortran/87487 * trans-decl.c (gfc_get_symbol_decl): Make sure that deferred character length pointer initializer has the right type to fix problem with deferred_character_24.f90 on big endian. From-SVN: r264862 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 521247c2dcc..7eece233640 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,13 @@ +2018-10-05 Paul Thomas + + PR fortran/87487 + * trans-decl.c (gfc_get_symbol_decl): Make sure that deferred + character length pointer initializer has the right type to fix + problem with deferred_character_24.f90 on big endian. + 2018-10-03 Jeff Law - * trans-types.c (get_typenode_from_name): Moved into gcc/tree.c. + * trans-types.c (get_typenode_from_name): Moved into gcc/tree.c. 2018-10-01 Paul Thomas diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index f7568d5a6c4..b0c12e5fc38 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1758,6 +1758,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) && TREE_CODE (length) != INTEGER_CST && TREE_CODE (sym->ts.u.cl->backend_decl) != INDIRECT_REF) { + length = fold_convert (gfc_charlen_type_node, length); gfc_finish_var_decl (length, sym); if (!sym->attr.associate_var && TREE_CODE (length) == VAR_DECL @@ -1767,6 +1768,8 @@ gfc_get_symbol_decl (gfc_symbol * sym) DECL_INITIAL (length) = gfc_conv_initializer (len, &len->ts, TREE_TYPE (length), false, false, false); + DECL_INITIAL (length) = fold_convert (gfc_charlen_type_node, + DECL_INITIAL (length)); } else gcc_assert (!sym->value);