http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165
--- Comment #5 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> --- (In reply to Jakub Jelinek from comment #3) > The code path exists in the code, It exists *only* if fn2() can return 0. But the fact is that in the reality, this can never happen (with the original non-reduced code, this can even be proved). > the fact that perhaps in your program such > code path is never taken doesn't mean it is undesirable to warn about it. > GCC has two kinds of warnings, the is uninitialized one where particular > code, if executed, will always use uninitialized value, and maybe > uninitialized, where it will use uninitialized value only conditionally. > That is the case here. But in this case, the warning is missing with -O2. > No, usually with more inlining it increases and should. When fn1 is not > inlined, GCC intentionally does not warn that c might be uninitialized > because maybe the function call could use the value or not set it > unconditionally, that would lead to so huge amount of false positives for > the warning that nobody would be willing to use the warning. This is the same problem with -O3: there is a false positive here. So, you have to choose whether you want to avoid false positives or not.
