[Patch, Fortran] PR 42647: Missed initialization/dealloc of allocatable scalar DT with allocatable component

Tobias Burnus burnus@net-b.de
Tue Oct 26 15:50:00 GMT 2010


On 10/25/2010 03:00 PM, Janus Weil wrote:
> The attached version of the patch does this and is regression-free. Ok 
> for trunk?

OK, but you can consider to remove
+                 rank = c->as ? c->as->rank : 0;
and use "c->as->rank" directly as the code is now guarded by an if 
(attr.dimension).

Thanks for the patch!

Tobias

> 2010-10-25  Janus Weil<janus@gcc.gnu.org>
>
> 	PR fortran/42647
> 	* trans.h (gfc_deallocate_scalar_with_status): New prototype.
> 	* trans.c (gfc_deallocate_scalar_with_status): New function for
> 	deallocation of allocatable scalars.
> 	* trans-decl.c (gfc_trans_deferred_vars): Call it here ...
> 	* trans-array.c (structure_alloc_comps): ... and here.
>
> 2010-10-25  Janus Weil<janus@gcc.gnu.org>
>
> 	PR fortran/42647
> 	* gfortran.dg/allocatable_scalar_9.f90: Extended.
> 	* gfortran.dg/allocatable_scalar_10.f90: New.
> 	* gfortran.dg/class_19.f03: Extended.



More information about the Fortran mailing list