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

Richard Guenther richard.guenther@gmail.com
Mon Aug 11 15:52:00 GMT 2008


On Mon, Aug 11, 2008 at 5:45 PM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> 2008/8/11 Richard Guenther <richard.guenther@gmail.com>:
>>>
>>> GCC does not bootstrap without that. It gives false positives for
>>> really weird cases that are obviously correctly initialized before
>>> used. That whole function was designed by trial and error until GCC
>>> bootstrapped.
>>
>> Huh.  Ok.  I think the patch should add testcases for (each) of them ;)
>
> I wish I could have testcases but every one I built did not show the
> original problem. I think they are caused (at least partially) by
> inlining.
>
>> Still it doesn't make much sense to me to exclude aggregates
>> or call clobbered variables.
>
> I am excluding everything that is not completely relevant to the
> testcase I posted above. If I could exclude further, I will. The goal
> is to increment the scope of the warning iteratively in further
> patches.

Well, I still think it is a bad idea to stick in code that seems
pointless to the reader ;)  If there is a testcase the reader can
check by removing the case and he'll see a failing testcase -- if
not he has to assume "black magic" (as I do now).

>>> I cannot use that because I only warn if there is 1 VUSE, otherwise I
>>> get false positives in bootstrap. I mentioned that I am trying to warn
>>> for a very specific case. Further patches should enhance this
>>> iteratively.
>>
>> I see.  In this case just use SINGLE_SSA_USE_OPERAND (use_stmt,
>> SSA_OP_VIRTUAL_USES).
>>
>
> Thanks, I will check that if the LOADED_SYM approach do not work.
>
>> Virtual SSA operators are exactly the same as LOADED_SYMS
>> (in fact, SSA VOPs are built walking over LOADED_SYMS).
>
> ?? Are they chained as well? And how you distinguish between VUSE and VDEF?

They are not chained - but now that I think for a second more you
want to know if they are the "default definition", so using LOADED_SYMS
will not work for checking if it was initialized or not.  (VDEFs are generated
from STORED_SYMS).

Richard.



More information about the Gcc-patches mailing list