Created attachment 41689 [details] Missed maybe-uninitialized warning: test case The attached test case should warn, as foo is used uninitialized if the "atoi(argv[1]) != 0" branch isn't taken. There are no warnings, even with "-Wall -Wextra". Tested with gcc 7.1, both with -O0 and with -O3, see https://godbolt.org/g/J5wRSM
There are a few duplicates of this bug floating around.
(In reply to Andrew Pinski from comment #1) > There are a few duplicates of this bug floating around. I figured, but I don't know anything about gcc internals to tell which of these duplicates are the same bug and which are different (same symptom, different internal cause).
foo is assumed initialized to 1 by CCP and the whole "atoi(argv[1]) != 0" branch is optimized away. -O0 does not warn because initialization is conditional. *** This bug has been marked as a duplicate of bug 18501 ***