Re: *ping* - Re: [Patch, Fortran] Enable FINALization/poly dealloc for allocatables

2013-06-04 Thread Tobias Burnus
Mikael Morin wrote: +++ b/gcc/fortran/trans-decl.c @@ -3872,7 +3892,8 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block) /* Deallocate when leaving the scope. Nullifying is not needed. */ - if (!sym->attr.result && !sym->attr

Re: *ping* - Re: [Patch, Fortran] Enable FINALization/poly dealloc for allocatables

2013-06-04 Thread Mikael Morin
Le 03/06/2013 12:22, Tobias Burnus a écrit : > * PING * > > Attached is just a re-diff. > > OK for the trunk? > Hello, it looks good; one question below... > diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c > index 100ec18..7521dee 100644 > --- a/gcc/fortran/trans-decl.c > +++ b/

Re: [Patch, Fortran] Enable FINALization/poly dealloc for allocatables

2013-05-31 Thread Tobias Burnus
And another one: I just realized that the following dead code can be removed (twice): + if (TREE_CODE (array) == ADDR_EXPR + && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (array, 0 +tmp = TREE_OPERAND (array, 0); As "tmp" is not used. That's part of gfc_build_final_call,t

Re: [Patch, Fortran] Enable FINALization/poly dealloc for allocatables

2013-05-30 Thread Tobias Burnus
Small update of the patch. Changes: * There was a problem finalizing "var(:)%comp", which lead to an ICE. Thanks to Dominique pointed out. See "expr->rank =" code added in gfc_add_finalizer_call. I added the full test case from PR37336 (dg-do compile: finalize_14.f90) to test for this. * I

[Patch, Fortran] Enable FINALization/poly dealloc for allocatables

2013-05-29 Thread Tobias Burnus
Dear all, this patch enables finalization (and polymorphic deallocation) for allocatables for: end of scope, DEALLOCATE and intent(out). As a side effect, an allocatable is no longer deallocated at the end of the main program. (Variables declared in the main program have automatically SAVE a