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

Janus Weil janus@gcc.gnu.org
Wed Oct 27 06:15:00 GMT 2010


2010/10/26 Tobias Burnus <burnus@net-b.de>:
> 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).

Committed with this change as r165973. Thanks for the review!

Cheers,
Janus



>> 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