This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36296] bogus uninitialized warning (loop representation, VRP missed-optimization)
- From: "vincent-gcc at vinc17 dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Apr 2013 08:40:09 +0000
- Subject: [Bug middle-end/36296] bogus uninitialized warning (loop representation, VRP missed-optimization)
- Auto-submitted: auto-generated
- References: <bug-36296-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36296
--- Comment #16 from Vincent LefÃvre <vincent-gcc at vinc17 dot net> 2013-04-17 08:40:09 UTC ---
(In reply to comment #3)
> A way to tell gcc a variable is not uninitialized is to perform
> self-initialization like
>
> int i = i;
>
> this will cause no code generation but inhibits the warning. Other compilers
> may warn about this construct of course.
What makes things worse about this workaround is that even protecting this by a
#if defined(__GNUC__)
may not be sufficient as other compilers may claim GNUC compatibility and
behave differently. This is the case of clang (at least under Debian):
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705583
The only good solution would be to fix the bug. I've checked that it is still
there in the trunk revision 197260 (current Debian's gcc-snapshot).