This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/55060] False un-initialized variable warnings
- 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, 25 Oct 2012 11:22:40 +0000
- Subject: [Bug tree-optimization/55060] False un-initialized variable warnings
- Auto-submitted: auto-generated
- References: <bug-55060-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55060
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-10-25
CC| |jamborm at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-25 11:22:40 UTC ---
At the point of the early uninit pass it sees:
main (int argc, char * * argv)
{
int i;
int D.1716;
int i.0;
<bb 2>:
a.isra.0 ();
# VUSE <.MEM_3(D)>
i.0_1 = i;
b.isra.1 ();
D.1716_2 = 0;
# .MEM_4 = VDEF <.MEM_3(D)>
i ={v} {CLOBBER};
# VUSE <.MEM_4>
return D.1716_2;
thus a read from the memory location 'i' which is uninitialized. Dead code
elimination has not yet removed that read (i.0_1 is unused after all).
I'd say the literal presence of b (i) is considered a use of i in C-terms,
thus the warning is not really incorrect.
That IPA-SRA has this side-effect on the otherwise still unoptimized
body of main is bad - early uninit was put before early inlining for a reason
and now IPA-SRA defeats this ... can we make it more "IPA" like and
have an explicit local transform stage?