This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR35721 Fix ASSOCIATE for different strides
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Fri, 28 Mar 2008 06:26:44 -0700
- Subject: Re: [Patch, Fortran] PR35721 Fix ASSOCIATE for different strides
- References: <47ECEE1E.3000201@net-b.de>
On Fri, 2008-03-28 at 14:09 +0100, Tobias Burnus wrote:
> The following was found by Dick Hendrickson (big kudos to him for
> running his big Fortran testsuite and reducing the failing tests!). The
> Fortran standard mandates:
>
> "Case (v): If TARGET is present and is an array target, the result is true if
> the target associated with POINTER and TARGET have the same shape, are neither
> of size zero nor arrays whose elements are zero-sized storage sequences, and
> occupy the same storage units in array element order. Otherwise, the result is
> false. If POINTER is disassociated, the result is false."
>
>
> gfortran was failing for:
>
> prt => array(2:1:-2)
> associated(ptr, array(2:2:1))
>
> Both the pointer and the array point to the same element (array(2)),
> although their strides are different.
>
> Bootstrapped on x86-64-linux and regtested there.
> OK for the trunk?
OK
> (Has someone a better idea for the variable name? "extent" is
> misleading; the real extent would be "upper-lower+1" and not "upper-lower".)
>
>
You could use "diff" since that is what you are doing or even "tmp"
since that is what it is.
Jerry