This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada files now checked in
- To: dnovillo at redhat dot com (Diego Novillo)
- Subject: Re: Ada files now checked in
- From: Joe Buck <jbuck at synopsys dot COM>
- Date: Mon, 15 Oct 2001 11:00:08 -0700 (PDT)
- Cc: jbuck at synopsys dot com (Joe Buck), amylaar at onetel dot net dot uk (Joern Rennecke), dewar at gnat dot com, bosch at gnat dot com, gcc at gcc dot gnu dot org, kenner at vlsi1 dot ultra dot nyu dot edu, zack at codesourcery dot com
> On Mon, 15 Oct 2001, Joe Buck wrote:
>
> > > This warning is not on by default, it's only triggered by
> > > -Wuninitialized. I expect more false positives for the 'maybe
> > > used uninitialized' message. Mostly because we are emitting the
> > > warning before any optimizations are performed.
> >
> > Ouch. You mean, even before constant folding and elimination of a
> > not-taken branch of an "if"? That would greatly increase the number of
> > false positives over what we have now.
> >
> Right now, yes. Over time we will start moving this warning down
> the transformation chain. There is work in progress to add
> constant propagation that should run before this.
>
> Of course, if you move this down too much you will go back to the
> problem of only supporting -Wuninitialized only if -O is used.
I'd rather require -O for -Wuninitialized than have a broken and useless
-Wuninitialized. You'll just steer people in the direction of making
their programs worse, by adding unneeded initializers.
Maybe the uninitialized warnings should be split in two. We can identify
three cases:
1) if the function is called an uninitialized use of foo will always occur.
2) if the function is called an uninitialized use of foo will never occur.
3) can't tell (analysis too weak, halting problem etc).
Improving the analysis reduces the size of set 3 and creates more members
of sets 1 and 2. But it seems that we could warn by default for set 1,
reporting obvious errors even with -O off, and have a flag that turns on
warnings for set 3.