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: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Apr 2013 09:19: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
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
--- Comment #17 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2013-04-17 09:19:09 UTC ---
(In reply to comment #16)
> (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.
> 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).
If you mean to fix the false warning, then you are likely to wait a long long
time (in order of years) because it doesn't seem a trivial thing to fix and
there are very very few people with enough GCC knowledge to fix it (and they
are busy with other things).
What would be trivial to fix (but require persistence, patience and time) is to
implement this idea:
http://gcc.gnu.org/ml/gcc/2010-08/msg00297.html
that is, either __attribute__ ((initialized))
or _Pragma("GCC diagnostic ignored \"-Wuninitialized\"").
(Personally, I prefer the latter, since it reuses existing code).
Add as a follow-up, get rid of the non-portable valgrind-unfriendly i=i idiom
that has caused so much grief over the years.
However, we still need someone with the persistence, patience and time to
implement this and get it past the powers that be.