This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -Og bug?
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Dmitry Vyukov <dvyukov at google dot com>, Alexey Samsonov <samsonov at google dot com>, Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 29 Jan 2014 10:37:55 +0100
- Subject: Re: -Og bug?
- Authentication-results: sourceware.org; auth=none
- References: <20131206075033 dot GE892 at tucnak dot redhat dot com> <CACT4Y+b4Txm5oWOCEC71OmU5+4sbxgpkx=6ziiXD7DPfBrpeoA at mail dot gmail dot com> <20131206082507 dot GF892 at tucnak dot redhat dot com> <CACT4Y+bn6bPbqcX4TghnQBKUe=JtVbxxrtKxA--z-5399hKUeg at mail dot gmail dot com> <CAGSYnCNgAB8G4mVFnA_TEkVyLKn2=ag_ef1ecrNn8HZTJtF1nw at mail dot gmail dot com> <20131206095337 dot GH892 at tucnak dot redhat dot com> <CAKOQZ8yPBfi3=tfxh7aZL0CPExX0EgGN+V3nYF2epERm0u+hPg at mail dot gmail dot com> <20131210113834 dot GQ892 at tucnak dot redhat dot com> <87bnyw41hf dot fsf at kepler dot schwinge dot homeip dot net> <CAKOQZ8xAXYOC0V2ZcDGymsUT32F4R35-qHYpcLjc2jQNvqJnPg at mail dot gmail dot com> <8738k83x3n dot fsf at kepler dot schwinge dot homeip dot net> <CAKOQZ8wuC+Zrt1LOmK8XmUYqZBiV8obYNje=wrYUyocuY6UmRA at mail dot gmail dot com> <871tzrq0bw dot fsf at schwinge dot name> <CAKOQZ8ys_SCrg91wT3q6RWCG7XFeX2EscfHxhVKwvPDOx3QFFQ at mail dot gmail dot com>
On Tue, Jan 28, 2014 at 10:24 PM, Ian Lance Taylor <iant@google.com> wrote:
> `On Tue, Jan 28, 2014 at 1:10 PM, Thomas Schwinge
> <thomas@codesourcery.com> wrote:
>>
>> OK, I agree to all of that, but I'd assume that if the compiler doesn't
>> do such value tracking to see whether all cases have been covered, it
>> also souldn't emit such possibly unitialized warning, to not cause false
>> positive warnings.
>
> The -Wuninitialized warning is full of false positives.
>
> It is the canonical example of why warnings that are driven by
> optimizations are difficult for users in practice.
Indeed. In this case it's of course the "optimistic" data-flow done by
the -Wuninit pass - if it were to assume that a value is initialized if
it cannot prove it isn't then we'd get no false positives but also a lot
of false negatives. Currently if it cannot prove it is initialized on a path
the pass assumes it is uninitialized on it.
As always you could do both dataflow kinds and add an extra "maybe"
before cases where both analyses do not agree.
Note that the current "maybe" is supposed to mean that there exists
a path to the use where the value seems to be(!) uninitialized. In contrast
to there exists a path to the use where the value _is_ uninitialized or
even "all paths to the use have the value uninitialized" (the cases where
no maybe is emitted).
Richard.
> Ian