This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (Re)allocation of allocatable arrays on assignment - F2003
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: paul dot richard dot thomas at gmail dot com, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Cc: dominiq at lps dot ens dot fr, burnus at net-b dot de
- Date: Sun, 31 Oct 2010 22:50:43 +0100
- Subject: Re: (Re)allocation of allocatable arrays on assignment - F2003
- References: <20101009134002.157E83BE0F@mailhost.lps.ens.fr> <AANLkTinUrNM2PSQdAoCb=PGEhNtyvx5-Czke8hKcCbJb@mail.gmail.com> <20101023202653.2DF9D3BE18@mailhost.lps.ens.fr> <AANLkTimcyDC-qh43tOCkaWwfsT2_RsW3MfZ3ChQRj3zp@mail.gmail.com> <4CC47A12.7050504@net-b.de> <AANLkTi=mxWu9dUeBrvgGeVeTMuB4DD=pEJnnsKxVMaKZ@mail.gmail.com>
Paul,
The patch fixes all the problem I know, but for the bounds when
the size has not changed:
[macbook] f90/bug% cat realloc_bnd.f90
real :: a(10)=1, b(51:60)=2
real, allocatable :: c(:), d(:)
c=a
print *, lbound(c), ubound(c)
c=b
print *, lbound(c), ubound(c)
d=b
print *, lbound(d), ubound(d)
d=a
print *, lbound(d), ubound(d)
if (any(lbound(d)/=1).or.any(ubound(d)/=10)) call abort()
end
[macbook] f90/bug% a.out
1 10
1 10
51 60
51 60
Abort
BTW I think the patch should not be delayed by this
last problem.
Thanks,
Dominique