On Wed, 19 Oct 2016, kugan wrote:

> Hi,
> 
> While computing jump function value range for pointer, I am wondering if we
> can assume that any tree with ADDR_EXPR will be nonnull.
> 
> That is, in cases like:
> 
> int arr[10];
> foo (&arr[1]);
> 
> OR
> 
> struct st
> {
>   int a;
>   int b;
> };
> struct st s2;
> foo (&s2.a);
> 
> Attached patch tries to do this. I am not sure if this can be wrong. Any
> thoughts?

It can be wrong for weak symbols for example.

Richard.

> Attached patch bootstraps and regression testing didn't introduce any new
> regressions.
> 
> Thanks,
> Kugan
> 
> 
> gcc/ChangeLog:
> 
> 2016-10-19  Kugan Vivekanandarajah  <kug...@linaro.org>
> 
>       * ipa-prop.c (ipa_compute_jump_functions_for_edge): Set
>       value range to nonull for ADDR_EXPR.
> 
> gcc/testsuite/ChangeLog:
> 
> 2016-10-19  Kugan Vivekanandarajah  <kug...@linaro.org>
> 
>       * gcc.dg/ipa/vrp5.c: New test.
>       * gcc.dg/ipa/vrp6.c: New test.
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 
21284 (AG Nuernberg)

Reply via email to