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

Vincent Lefèvre <vincent-gcc at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent-gcc at vinc17 dot net

--- Comment #6 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(In reply to Manuel López-Ibáñez from comment #4)
> It warns in gcc 10.1. It may good idea to add this one as a testcase, since
> it seems it got fixed without noticing.

Has this really been fixed, or does it work now just by chance?

This looks like PR18501, where the concerned variable is initialized only at
one place in the loop. Here, "z = 1" is followed by "z=z+1", so that this is
equivalent to "z = 2". But if in the code, I do this change, the warning
disappears (tested with gcc-12 (Debian 12-20220222-1) 12.0.1 20220222
(experimental) [master r12-7325-g2f59f067610] and -O1, -O2, -O3).

Reply via email to