This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 20644 bogus uninitialized warning on unused variable
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- Cc: "Gcc Patch List" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 10 Aug 2008 19:59:01 +0200
- Subject: Re: PR 20644 bogus uninitialized warning on unused variable
- References: <6c33472e0808100214h5389cf9n6a84ff1dbef07198@mail.gmail.com>
On Sun, Aug 10, 2008 at 11:14 AM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> The issue is that we warn too early about things that we are not sure
> about. The fix is to delay the "may be" warnings to the late pass.
> However, if no optimization is given we have to give all warnings in
> the early pass.
>
> Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
> --enable-languages=all,ada
>
> OK for trunk?
Ok.
Thanks,
Richard.
> 2008-08-10 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
>
> PR middle-end/20644
> * tree-ssa.c (struct walk_data): Add new flag
> warn_possibly_uninitialized.
> (warn_uninitialized_var): Use it.
> (warn_uninitialized_vars): New.
> (execute_early_warn_uninitialized): Call it.
> (execute_late_warn_uninitialized): Likewise.
> testsuite/
> * gcc.dg/uninit-pr20644-O0.c: New.
> * gcc.dg/uninit-pr20644.c: New.
>