This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wuninitialized issues
- From: Jeffrey A Law <law at redhat dot com>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: gcc at gcc dot gnu dot org, "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>, dnovillo at redhat dot com, mark at codesourcery dot com
- Date: Wed, 02 Nov 2005 11:49:38 -0700
- Subject: Re: -Wuninitialized issues
- References: <Pine.LNX.4.61.0511021147580.14971@nondot.org>
- Reply-to: law at redhat dot com
On Wed, 2005-11-02 at 12:01 -0600, Chris Lattner wrote:
[ ... big snip ... ]
> For users like myself, I would really like to have an option to switch the
> unused var warning to be emitted from the *front-end* where it works when
> compiling with optimization disabled (a huge feature in itself) and where
> the warnings are more stable. I know that it is impossible to guarantee
> that GCC will ever match "other compilers", and that there will be false
> positives (e.g. double diamond patterns), but for many uses this is
> perfectly fine (other compilers warn about the same cases, so these cases
> already have initializers).
I think it's worth noting that we build the SSA form even when we're
not optimizing. Which in turn with running the maybe-uninitialized
warning code early would give you the warnings you expect without
needing to run the optimizers. That's why I don't think we need to push
these warnings into the front-ends.
And I agree, we certainly have long term questions/issues regarding
how things like IPA affect our ability to give good warnings. It's
an area I've got very very little experience with though.
Jeff