re PR testsuite/87487 (New test case gfortran.dg/deferred_character_24.f90 in r264721 fails on big endian)

2018-10-05  Paul Thomas  <pault@gcc.gnu.org>

	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
This commit is contained in:
Paul Thomas 2018-10-05 07:01:57 +00:00
parent 1afa270f17
commit 3665f77c7f
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,13 @@
2018-10-05 Paul Thomas <pault@gcc.gnu.org>
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 <law@redhat.comg>
* 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 <pault@gcc.gnu.org>

View File

@ -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);