This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]