This is the mail archive of the gcc-patches@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]

[RFC][IPA-VRP] ADDR_EXPR and nonnull


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?

Attached patch bootstraps and regression testing didn't introduce any new regressions.

Thanks,
Kugan


gcc/ChangeLog:

2016-10-19  Kugan Vivekanandarajah  <kuganv@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  <kuganv@linaro.org>

	* gcc.dg/ipa/vrp5.c: New test.
	* gcc.dg/ipa/vrp6.c: New test.

Attachment: p.txt
Description: Text document


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