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

--- Comment #8 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Leon Winter from comment #7)
> Maybe a better solution is to hint the compiler that the loop body will be
> run at least once. A do-while seems to imply that (and the compiler does not
> print a warning).

Not for the minimized testcase. Unless you declare 'a' within the loop body,
which is not exactly equivalent.

If you declare it outside the loop body, gcc generates exactly the same code
for a 'for' and a 'do-while'.

Reply via email to