Commit 3665f77c by Paul Thomas

re PR testsuite/87487 (New test case gfortran.dg/deferred_character_24.f90 in…

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
parent 1afa270f
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> 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> 2018-10-01 Paul Thomas <pault@gcc.gnu.org>
......
...@@ -1758,6 +1758,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -1758,6 +1758,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
&& TREE_CODE (length) != INTEGER_CST && TREE_CODE (length) != INTEGER_CST
&& TREE_CODE (sym->ts.u.cl->backend_decl) != INDIRECT_REF) && TREE_CODE (sym->ts.u.cl->backend_decl) != INDIRECT_REF)
{ {
length = fold_convert (gfc_charlen_type_node, length);
gfc_finish_var_decl (length, sym); gfc_finish_var_decl (length, sym);
if (!sym->attr.associate_var if (!sym->attr.associate_var
&& TREE_CODE (length) == VAR_DECL && TREE_CODE (length) == VAR_DECL
...@@ -1767,6 +1768,8 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -1767,6 +1768,8 @@ gfc_get_symbol_decl (gfc_symbol * sym)
DECL_INITIAL (length) = gfc_conv_initializer (len, &len->ts, DECL_INITIAL (length) = gfc_conv_initializer (len, &len->ts,
TREE_TYPE (length), TREE_TYPE (length),
false, false, false); false, false, false);
DECL_INITIAL (length) = fold_convert (gfc_charlen_type_node,
DECL_INITIAL (length));
} }
else else
gcc_assert (!sym->value); gcc_assert (!sym->value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment