This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFH] PR middle-end/179 gcc -O2 -Wuninitialized missing warning with &var


On Fri, Aug 15, 2008 at 8:06 AM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> 2008/8/14 Daniel Berlin <dberlin@dberlin.org>:
>> 1. You can't assume VUSE's are must-aliases.  The fact that there is a
>> vuse for something does not imply it is must-used, it implies it is
>> may-used.
>>
>> We do not differentiate may-use from must-use in our alias system. You
>> can do some trivial must-use analysis if you like (by computing
>> cardinality of points-to set as either single or multiple and
>> propagating/meeting it in the right place).
>>
>> Must-use is actually quite rare.
>
> Then, is it impossible to distinguish the following testcase and the
> one from my previous mail with the current infrastructure?

If by current you mean "code that already exists", then yes :)
You could write code to do further analysis, but with the existing
code, it will not work.

>
>> 2. " if (!gimple_references_memory_p (def))
>> +       return;
>> +"
>> Is nonsensical the SSA_NAME_DEF_STMT of a vuse must contain a vdef,
>> and thus must access memory.
>
> Two things here.
>
> 1) The case I am trying to war about is:
>
>  # BLOCK 2 freq:10000
>  # PRED: ENTRY [100.0%]  (fallthru,exec)
>  [/home/manuel/src/trunk/gcc/testsuite/gcc.dg/uninit-B.c : 12] # VUSE
> <iD.1951_4(D)> { iD.1951 }
>  i.0D.1952_1 = iD.1951;
>  [/home/manuel/src/trunk/gcc/testsuite/gcc.dg/uninit-B.c : 12] if
> (i.0D.1952_1 != 0)
>
> The def_stmt of i.0 is precisely that one. There is no vdef there.

Sure but this is a default def, which are special, and do nothing anyway.


>
> 2) I use that test to return early if the def_stmt of "t" does not
> reference memory. t is just a SSA_NAME (like i.0 above), I do not know
> whether its def_stmt has a VUSE like the above or not. I guess the
> test is redundant since SINGLE_SSA_USE_OPERAND will return NULL
> anyway. Is that what yo mean?
>
No, i mean any SSA_NAME_DEF_STMT for a vuse that is not a default_def
will reference memory.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]