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: Memory (de)allocation again..


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


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