[Patch, Fortran] PR 42647: Missed initialization/dealloc of allocatable scalar DT with allocatable component
Janus Weil
janus@gcc.gnu.org
Tue Oct 12 22:10:00 GMT 2010
>> This seems to work fine at -O0, but the patch currently still has two
>> regressions at -O1 and higher:
>> * allocatable_scalar_9.f90
>> * class_19.f03
>>
>> allocatable_scalar_9.f90:29:0: error: statement makes a memory store,
>> but has no VDEFS
>> a4_193.b4.data = 0B;
>> allocatable_scalar_9.f90:29:0: internal compiler error: verify_ssa failed
>
> Well, the reason that it only fails with -O1 is simple: The check is guarded
> by "optimization > 0".
>
> Regarding the issue itself: Try in gfc_auto_deallocate:
>
> tmp = build_fold_indirect_ref_loc (input_location, pointer);
> tmp = gfc_deallocate_alloc_comp (sym->ts.u.derived, tmp,
> sym->as ? sym->as->rank : 0);
Great, that seems to fix it. Thanks a lot!
I will check the updated patch with another testsuite run. Ok for
trunk if that passes?
Cheers,
Janus
2010-10-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/42647
* trans.h (gfc_auto_deallocate): New prototype.
* trans.c (gfc_auto_deallocate): New function for auto-deallocation
of allocatable scalars.
* trans-decl.c (gfc_trans_deferred_vars): Call it here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr42647_v3.diff
Type: application/octet-stream
Size: 2572 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20101012/ab032b7a/attachment.obj>
More information about the Fortran
mailing list