This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, Fortran, alloc_poly, v1] Fix allocation of memory for polymorphic assignment
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Andre Vehreschild <vehre at gmx dot de>
- Cc: GCC-Patches-ML <gcc-patches at gcc dot gnu dot org>, GCC-Fortran-ML <fortran at gcc dot gnu dot org>, Damian Rouson <damian at sourceryinstitute dot org>
- Date: Mon, 19 Dec 2016 13:25:17 +0100
- Subject: Re: [PATCH, Fortran, alloc_poly, v1] Fix allocation of memory for polymorphic assignment
- Authentication-results: sourceware.org; auth=none
- References: <20161219124343.3c3baf4c@vepi2>
Hi Andre,
> attached is a patch to fix the incorrect computation of memory needed in a
> polymorphic assignment. Formerly the memory required could not be determined
> and therefore one byte was allocated. This is fixed now, by retrieving the
> size needed from the _vptr->size.
>
> Bootstraps and regtests ok on x86_64-linux/f23. Ok for trunk?
Two questions after quickly skimming over it ...
1) After adding that code block in gfc_trans_assignment_1, it seems
like the comment above is outdated, right?
2) Wouldn't it be better to move this block, which does the correct
allocation for CLASS variables, into
"alloc_scalar_allocatable_for_assignment", where the allocation for
all other cases is done?
Cheers,
Janus
> Regards,
> Andre
> --
> Andre Vehreschild * Email: vehre ad gmx dot de