This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Fix PR 21912: handle negative steps in implied-do-loop in array constructor
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Tobias Schl?ter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 5 Jun 2005 08:12:54 -0700
- Subject: Re: [gfortran] Fix PR 21912: handle negative steps in implied-do-loop in array constructor
- References: <42A2FD47.9050902@physik.uni-muenchen.de>
On Sun, Jun 05, 2005 at 03:25:27PM +0200, Tobias Schl?ter wrote:
>
> The issue was that for an implied do-loop with a negative step value, say
> 'i=n,1,-1', the exit condition would be 'i > 1' instead of 'i < 1', because we
> would always generate a GT_EXPR instead of checking the direction in which
> we're going.
>
> The fix is straightforward, but since I was touching that function, I slightly
> restructured it to make it IMO more readable.
>
> Bubblestrapped and tested. OK for 4.0 and mainline? I'll commit a testcase
> alongside this.
>
> - Tobi
>
> 2005-06-05 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
>
> PR fortran/21912
> * trans-array.c (gfc_trans_array_constructor_value): Slightly reorder.
> Generate correct exit condition in case of negative steps in
> implied-do loops.
Ok.
--
Steve