This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42647] Missed initialization/dealloc of allocatable scalar DT with allocatable component
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 May 2010 22:29:09 -0000
- Subject: [Bug fortran/42647] Missed initialization/dealloc of allocatable scalar DT with allocatable component
- References: <bug-42647-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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