https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78293
--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> --- Author: pault Date: Wed Nov 1 17:24:35 2017 New Revision: 254319 URL: https://gcc.gnu.org/viewcvs?rev=254319&root=gcc&view=rev Log: 2017-11-01 Andre Vehreschild <ve...@gcc.gnu.org> Paul Thomas <pa...@gcc.gnu.org> PR fortran/78293 * trans-expr.c (gfc_conv_procedure_call): Prepend deallocation of alloctable components to post, rather than adding to se->post. * trans-stmt.c (gfc_trans_allocate): Move deallocation of expr3 allocatable components so that all expr3s are visited. 2017-11-01 Paul Thomas <pa...@gcc.gnu.org> PR fortran/78293 * gfortran.dg/allocatable_function_10.f90: New test. * gfortran.dg/class_array_15.f03: Increase builtin_free count from 11 to 12. Added: branches/gcc-6-branch/gcc/testsuite/gfortran.dg/allocatable_function_10.f90 Modified: branches/gcc-6-branch/gcc/fortran/ChangeLog branches/gcc-6-branch/gcc/fortran/trans-expr.c branches/gcc-6-branch/gcc/fortran/trans-stmt.c branches/gcc-6-branch/gcc/testsuite/ChangeLog branches/gcc-6-branch/gcc/testsuite/gfortran.dg/class_array_15.f03