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

Mikael Morin mikael.morin@sfr.fr
Tue Jun 4 08:57:00 GMT 2013


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



More information about the Fortran mailing list