PR middle-end/179 gcc -O2 -Wuninitialized missing warning with &var
Manuel López-Ibáñez
lopezibanez@gmail.com
Wed Aug 20 10:58:00 GMT 2008
2008/8/20 Richard Guenther <richard.guenther@gmail.com>:
> On Wed, Aug 20, 2008 at 11:51 AM, Manuel López-Ibáñez
> <lopezibanez@gmail.com> wrote:
>> A different approach.
>>
>> Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
>> --enable-languages=all,ada
>>
>> I am not sure if there is a PR open for the XFAIL in uninit-6.c
>>
>> OK for trunk?
>
> This looks much better! A few nits:
>
> + /* We do not care about LHS. */
> + if (wi->is_lhs)
> + return NULL_TREE;
> +
>
> I do not see this is_lhs member set or defined anywhere... the test
> also looks superfluous.
If I understand the description of struct walk_stmt_info in gimple.h:
/* True if we are currently walking the LHS of an assignment. */
bool is_lhs;
And walk_tree updates it automatically. See count_ptr_derefs in
tree-ssa-alias.c for example of usage.
> + /* If there is not gimple stmt, then we cannot check VUSE ops. */
> + if (data->stmt == NULL)
> + return NULL_TREE;
>
> In addition I would add
>
> || !gimple_aliases_computed_p (cfun)
> || !ZERO_SSA_OPERANDS (data->stmt, SSA_OP_VIRTUAL_DEFS))
>
> which should catch the wi->is_lhs case as well as calls and struct
> copies.
I can test that. Could you give me an explanation of why we want to
test the second? I do not get it and I would like to add a comment
explaining it.
Cheers,
Manuel.
More information about the Gcc-patches
mailing list