This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Feb 2014 09:21:36 +0000
- Subject: [Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2
- Auto-submitted: auto-generated
- References: <bug-60165-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> (In reply to Vincent LefÃvre from comment #2)
> > Well, the code paths in question do not necessarily exist (you could say the
> > same thing with -O2, where the function is not inlined: there may be some
> > code paths for which fn1() doesn't initialize c).
>
> The code path exists in the code, 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.
Where it of course still only assumes that the function is entered at all.