This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/22197] invalid "is" used uninitialized, should be "may be"
- From: "matz at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2005 13:50:38 -0000
- Subject: [Bug middle-end/22197] invalid "is" used uninitialized, should be "may be"
- References: <20050627132516.22197.matz@suse.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From matz at suse dot de 2005-06-27 13:50 -------
Hmm, sort of. The call of g(i) also warns with "is used", although I
think it might deserve only a "may be used". But anyway I think that
this nevertheless has different causes. It's not the call creating
the problem, but the copy itself. On could for instance delete the
call and instead make 'testarray' volatile (so that the copy is not
optimized away). This would still warn, IMHO incorrectly.
What's even stranger is, that if I add a call "forget(testvar)" then
the warning vanishes. I.e. like so:
-------------------------------------
int main() {
struct testme volatile testarray[1];
struct testme testvar;
testvar.testval = 0;
testarray[0] = testvar;
forget (testvar);
return 0;
}
-------------------------------------
So this shows that not the call on a partly initialized struct is the
problem (because that is still the case with the above), but something
in SRA dealing with the copy. If one removes the call to forget above
the warning will return (note the added volatile) on the copy.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22197