This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ipa-vrp] Use get/set_ptr_nonnull in ipa-vrp
- From: kugan <kugan dot vivekanandarajah at linaro dot org>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, Jeff Law <law at redhat dot com>, Martin Jambor <mjambor at suse dot cz>
- Date: Fri, 14 Oct 2016 10:22:36 +1100
- Subject: Re: [ipa-vrp] Use get/set_ptr_nonnull in ipa-vrp
- Authentication-results: sourceware.org; auth=none
- References: <717fb095-f0a9-6980-ddbd-e755a4fd6457@linaro.org> <867817be-aaed-7e0f-9d77-ba9e0b639f48@linaro.org> <20161012111610.GG65577@kam.mff.cuni.cz>
Hi Honza,
On 12/10/16 22:16, Jan Hubicka wrote:
Hi,
This patch uses the get/set_ptr_nonnull so that ipa-vrp also
propagates nonnull ranges for pinter.
Bootstrapped and regression tested this with other patched without
any new regressions on x86_64-linux-gnu.
Is this OK for trunk?
Thanks,
Kugan
gcc/ChangeLog:
2016-10-12 Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Set value range
for pointer type too.
(ipcp_update_vr): set_ptr_nonnull for pointer.
gcc/testsuite/ChangeLog:
2016-10-12 Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
* gcc.dg/ipa/vrp4.c: New test.
OK, thank you!
We should be able to derive a lot of (useful) non-null information from the
fact that the pointers are dereferenced either prior the function call or in a
statement that postdominate the function entry.
I will try with spec2k/2006. Do you have any specific benchmark in mind
that I can try first?
I guess we could also give (semi)
useful -Wmissing-attribute=nonnull hints in that case.
I will send a follow up patch for this.
Thanks,
Kugan
Honza