https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61831
--- Comment #49 from Mikael Morin <mikael at gcc dot gnu.org> --- Author: mikael Date: Fri Jul 17 09:40:29 2015 New Revision: 225926 URL: https://gcc.gnu.org/viewcvs?rev=225926&root=gcc&view=rev Log: Fix PR61831: Side-effect variable component deallocation gcc/fortran/ 2015-07-17 Mikael Morin <mik...@gcc.gnu.org> Dominique d'Humieres <domi...@lps.ens.fr> PR fortran/61831 * trans-array.c (gfc_conv_array_parameter): Guard allocatable component deallocation code generation with descriptorless calling convention flag. * trans-expr.c (gfc_conv_expr_reference): Remove allocatable component deallocation code generation from revision 212329. (expr_may_alias_variables): New function. (gfc_conv_procedure_call): New boolean elemental_proc to factor check for procedure elemental-ness. Rename boolean f to nodesc_arg and declare it in the outer scope. Use expr_may_alias_variables, elemental_proc and nodesc_arg to decide whether generate allocatable component deallocation code. (gfc_trans_subarray_assign): Set deep copy flag. gcc/testsuite/ 2015-07-17 Mikael Morin <mik...@gcc.gnu.org> PR fortran/61831 * gfortran.dg/alloc_comp_auto_array_3.f90: Count the number of generated while loops in the tree dump. * gfortran.dg/derived_constructor_components_6.f90: New file. Added: trunk/gcc/testsuite/gfortran.dg/derived_constructor_comps_6.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-array.c trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/alloc_comp_auto_array_3.f90