re PR fortran/58586 (ICE with derived type with allocatable component passed by value)
authorAndre Vehreschild <vehre@gmx.de>
Mon, 6 Jul 2015 10:26:12 +0000 (12:26 +0200)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Mon, 6 Jul 2015 10:26:12 +0000 (12:26 +0200)
commitc16126ac1815c23771abc76d7daa30662dc31379
treec52a82843f3c1435cfba1b2ed903bdb4e71476cb
parentc8ba649886633947106b28f1ebf43b3b0d86be6c
re PR fortran/58586 (ICE with derived type with allocatable component passed by value)

gcc/testsuite/ChangeLog:

2015-07-06  Andre Vehreschild  <vehre@gmx.de>

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  <vehre@gmx.de>

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/ChangeLog
gcc/fortran/resolve.c
gcc/fortran/trans-decl.c
gcc/fortran/trans-expr.c
gcc/fortran/trans.h
gcc/testsuite/gfortran.dg/alloc_comp_class_3.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/alloc_comp_class_4.f03 [new file with mode: 0644]