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

--- Comment #14 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #12)
> Handle loop steps other than ±1.

Fortran (here F2023) has under "11.1.7.4.3 The execution cycle" (for "DO"):
"... consists of the following steps ..."
"(1) The iteration count, if any, is tested. If it is zero, the loop terminates
...
"(2) The block of the loop is executed.28
"(3) The iteration count, if any, is decremented by one. The DO variable, if
any, is incremented by the value of the incrementation parameter m3."

And Fortran states: "The execution of any numeric operation whose result is not
defined by the arithmetic used by the processor is prohibited." (10.1.5.2.4
Evaluation of numeric intrinsic operations).

* * *

Thus (cf. email linked in comment 12), simply extending this to any constant
step should be possible. (For the other cases, see email.)

Reply via email to