------- Comment #8 from janus at gcc dot gnu dot org 2010-05-15 22:29 ------- (In reply to comment #7) > For the automatic deallocation there is be a problem remaining: > > In comment #0, "a" itself is now automatically deallocated, but not "a%d" any > more.
This is fixed by this patchlet (which is part of patch in comment #1): Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (revision 159445) +++ gcc/fortran/trans-decl.c (working copy) @@ -3272,6 +3272,9 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tr gfc_se se; stmtblock_t block; + if (sym_has_alloc_comp) + fnbody = gfc_trans_deferred_array (sym, fnbody); + e = gfc_lval_expr_from_sym (sym); if (sym->ts.type == BT_CLASS) gfc_add_component_ref (e, "$data"); Also the use-association issue still needs to be taken care of. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42647