From c16126ac1815c23771abc76d7daa30662dc31379 Mon Sep 17 00:00:00 2001 From: Andre Vehreschild Date: Mon, 6 Jul 2015 12:26:12 +0200 Subject: re PR fortran/58586 (ICE with derived type with allocatable component passed by value) gcc/testsuite/ChangeLog: 2015-07-06 Andre Vehreschild PR fortran/58586 * gfortran.dg/alloc_comp_class_3.f03: New test. * gfortran.dg/alloc_comp_class_4.f03: New test. gcc/fortran/ChangeLog: 2015-07-06 Andre Vehreschild PR fortran/58586 * resolve.c (resolve_symbol): Non-private functions in modules with allocatable or pointer components are marked referenced now. Furthermore is the default init especially for those components now done in gfc_conf_procedure_call preventing duplicate code. * trans-decl.c (gfc_generate_function_code): Generate a fake result decl for functions returning an object with allocatable components and initialize them. * trans-expr.c (gfc_conv_procedure_call): For value typed trees use the tree without indirect ref. And for non-decl trees add a temporary variable to prevent evaluating the tree multiple times (prevent multiple function evaluations). * trans.h: Made gfc_trans_structure_assign () protoype available, which is now needed by trans-decl.c:gfc_generate_ function_code(), too. From-SVN: r225447 --- gcc/fortran/trans.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/fortran/trans.h') diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index e618088..f7cf5f0 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -669,6 +669,9 @@ tree gfc_deallocate_scalar_with_status (tree, tree, bool, gfc_expr*, gfc_typespe /* Generate code to call realloc(). */ tree gfc_call_realloc (stmtblock_t *, tree, tree); +/* Assign a derived type constructor to a variable. */ +tree gfc_trans_structure_assign (tree, gfc_expr *, bool); + /* Generate code for an assignment, includes scalarization. */ tree gfc_trans_assignment (gfc_expr *, gfc_expr *, bool, bool); -- cgit v1.1