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: [Patch, Fortran] PR 42647: Missed initialization/dealloc of allocatable scalar DT with allocatable component


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


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