This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Warning regression with COMPARE fixes
- To: gcc at gcc dot gnu dot org, Geoff Keating <geoffk at cygnus dot com>
- Subject: Warning regression with COMPARE fixes
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 19 Mar 2001 13:41:35 -0800
- Organization: CodeSourcery, LLC
My recent checkin to fix the ARM bootstrap problem (the patch that
fixed an over-agressive optimization in CSE), apparently causes the
PowerPC compiler to emit a warning about this code:
int
sub ()
{
int i = 0;
int j = 0;
int k; /* { dg-bogus "`k' might be used uninitialized" "uninitialized warning regression" } */
while (i == 0 && j == 0)
{
k = 10;
i = sub ();
}
return k;
}
where it did not previously do so. In particular, the compiler again
complains that k might be used uninitialized.
I am not planning on investigating this regression further. It would
be good to avoid this warning, but GCC's emission of this particular
warning is already highly unpredictable due to the ways in which we
attempt to use the optimizers to decide when to generate the warning.
(I believe this to be a mistake, but that's another, much longer,
argument.)
In any case, I'd like other people's opinion on the question of
whether or not this warning regression needs fixing. I have no idea
how we might go about doing that; the key step, of course, is making
sure the compiler realizes that the while-condition will be true the
first time it is encountered. I understand how to do that
algorithmically, but I have no idea what it would take in the compiler
to regain that knowledge.
Thoughts, comments?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com