This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: *ping* - Re: [Patch, Fortran] Enable FINALization/poly dealloc for allocatables
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Tue, 04 Jun 2013 10:56:11 +0200
- Subject: Re: *ping* - Re: [Patch, Fortran] Enable FINALization/poly dealloc for allocatables
- References: <51A5BC22 dot 3010600 at net-b dot de> <51A72907 dot 3030107 at net-b dot de> <51A88346 dot 4000509 at net-b dot de> <51A8D16B dot 3050701 at net-b dot de> <51AC6E6B dot 3020809 at net-b dot de>
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/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.dummy)
> + if (!sym->attr.result && !sym->attr.dummy
> + && !sym->ns->proc_name->attr.is_main_program)
>
No check for !sym->attr.save here?
There are several places through the patch where we check whether a
variable needs end of scope automatic deallocation. Might be worth
factoring the checks to a common predicate.
The patch is OK in any case; thanks.
Mikael