Commit d0c4f314 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/92781 (ICE in convert_nonlocal_reference_op, at tree-nested.c:1065)

	PR fortran/92781
	* trans-decl.c (gfc_get_symbol_decl): If sym->backend_decl is
	current_function_decl, add length to current rather than parent
	function and expect DECL_CONTEXT (length) to be current_function_decl.

	* gfortran.dg/pr92781.f90: New test.

From-SVN: r278988
parent ad774d0d
2019-12-05 Jakub Jelinek <jakub@redhat.com>
PR fortran/92781
* trans-decl.c (gfc_get_symbol_decl): If sym->backend_decl is
current_function_decl, add length to current rather than parent
function and expect DECL_CONTEXT (length) to be current_function_decl.
2019-12-04 Tobias Burnus <tobias@codesourcery.com>
PR fortran/92754
......
......@@ -1631,15 +1631,18 @@ gfc_get_symbol_decl (gfc_symbol * sym)
/* Add the string length to the same context as the symbol. */
if (DECL_CONTEXT (length) == NULL_TREE)
{
if (DECL_CONTEXT (sym->backend_decl)
== current_function_decl)
if (sym->backend_decl == current_function_decl
|| (DECL_CONTEXT (sym->backend_decl)
== current_function_decl))
gfc_add_decl_to_function (length);
else
gfc_add_decl_to_parent_function (length);
}
gcc_assert (DECL_CONTEXT (sym->backend_decl)
== DECL_CONTEXT (length));
gcc_assert (sym->backend_decl == current_function_decl
? DECL_CONTEXT (length) == current_function_decl
: (DECL_CONTEXT (sym->backend_decl)
== DECL_CONTEXT (length)));
gfc_defer_symbol_init (sym);
}
......
2019-12-05 Jakub Jelinek <jakub@redhat.com>
PR fortran/92781
* gfortran.dg/pr92781.f90: New test.
2019-12-05 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/diagnostic/functional-cast-to-array-type-1.C: New.
......
! PR fortran/92781
! { dg-do compile }
function foo ()
character(:), allocatable :: foo
call bar ()
foo = 'abc'
contains
subroutine bar
end
end
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