This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Patch, Fortran] PR35721 Fix ASSOCIATE for different strides


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


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