This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Memory (de)allocation again..
- From: "François-Xavier Coudert" <fxcoudert at gmail dot com>
- To: "Paul Thomas" <paulthomas2 at wanadoo dot fr>
- Cc: patch <gcc-patches at gcc dot gnu dot org>, fortran at gcc dot gnu dot org
- Date: Mon, 29 May 2006 16:59:39 +0200
- Subject: Re: Memory (de)allocation again..
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=i2NvMAvfuzjIyBgTGt/eIlW2hGsOseUW+46Xc+ifPh+88SNS4Rd/8H9MXHDdZN2rhHOxUvzAnqoGS8qOULtGYW7genAy0REHGSprhntkRtt/xVFoI/Kg+SjlemxvS+mo9eauQC3n2vfVSnBNU942eqdI3O2dWw0p4DpYxUiPGxw=
- References: <756DFD3DE8F1D411A59A00306E06E84705CBEFE1@drfccad.cad.cea.fr> <19c433eb0605230432o36308a99wcee0bf80164e84ce@mail.gmail.com> <4475F70C.8080609@wanadoo.fr>
2006-05-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/27613
* trans-intrinsic.c (gfc_conv_associated): If pointer in first arg
has zero array length of zero string length, return false.
I just realized this patch was not OK. The zero-length conditions are
only valid in presence of a TARGET (see F2003 13.7.13):
Case (i): If TARGET is absent, the result is true if POINTER is
associated with a target
and false if it is not.
A testcase for this problem is for example:
$ cat a.f90
REAL, DIMENSION(:,:), POINTER :: x
real, target :: a(0,2)
x => a
print *, associated(x)
end
pc31 /tmp $ ifort a.f90 && ./a.out
T
pc31 /tmp $ gfortran a.f90 && ./a.out
F
I am now a bit confused about whether we should move the condition
inside the block for "An optional target", or simply remove it.
Sorry for not doing the review right,
FX