[gfortran] Fix PR 21912: handle negative steps in implied-do-loop in array constructor

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Jun 5 15:13:00 GMT 2005


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



More information about the Gcc-patches mailing list