https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42108

--- Comment #66 from Salvatore Filippone <sfilippone at uniroma2 dot it> ---
As far as I remember(In reply to rguent...@suse.de from comment #65)
> On Wed, 10 Dec 2014, burnus at gcc dot gnu.org wrote:
> 
> > Fortran 66 compilers did. For instance, "DO i = 2, 1" would then be executed
> > once. (Such loops are not permitted in F66 - and some compilers executed 
> > them
> > once others zero times; since F77, such loops are permitted and executed 
> > zero
> > times. Unsurprisingly, some old code from the 60s relies on the execute once
> > feature.)
> > 
> > g77 and some commercial compilers have a compile flag like "-f66", gfortran
> > hasn't and I don't think it ever will.]
> 
> I wondered if
> 
>   DO i = 1, 1, 0
> 
> is valid (a step of zero).  Note that DO i = 2, 1 wouldn't be executed
> once with the current generated code, only DO i = 1, 1 is, but with
> step == 0 it would divide by zero.

Step 0 is not allowed (see e.g. F2003 Handbook, sect. 8.7.2.1.1). 
Salvatore

Reply via email to