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

Tobias Burnus burnus@net-b.de
Tue Oct 12 20:53:00 GMT 2010


  Janus Weil wrote:
> 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);

Tobias



More information about the Gcc-patches mailing list