[Patch,Fortran] PRs 45451 / 43018: Fixes for allocatables
Tobias Burnus
burnus@net-b.de
Tue Oct 26 05:59:00 GMT 2010
Hi,
this patch fixes two things:
a) PR 43018: For duplicate_allocatable the size was wrong: gfortran used
for scalars the size of the pointer and not the size of the type.
I have not added a test case as it was found via the valgrind error of
gfortran.de/alloc_comp_scalar_1.f90; the test case also fails one one
system (s390?).
b) PR 45451: If one does an ALLOCATE with SOURCE=, one needs to do a
deep copy if there are allocatable components.
Without the non-variable case, it fails for the first ALLOCATE statement
in gfortran.dg/allocate_alloc_opt_10.f90, where the source is an
EXPR_STRUCTURE.
Build an regtested on x86-64-linux.
OK for the trunk?
Tobias
PS: This patch does not fix all problems with PR 45451. It also does not
fix the case of a polymorphic SOURCE= with allocatable components (cf.
new PR 46174).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allocate-fix.diff
Type: text/x-patch
Size: 2563 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20101026/43c5e3d4/attachment.bin>
More information about the Fortran
mailing list