public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: kugan <kugan.vivekanandarajah@linaro.org>
To: Richard Biener <rguenther@suse.de>
Cc: Jan Hubicka <hubicka@ucw.cz>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [RFC][IPA-VRP] ADDR_EXPR and nonnull
Date: Wed, 19 Oct 2016 08:48:00 -0000	[thread overview]
Message-ID: <0987d0d3-9b7b-eeb8-cf2a-17d1d0df7f49@linaro.org> (raw)
In-Reply-To: <alpine.LSU.2.11.1610191023250.2258@t29.fhfr.qr>

Hi Richard,


On 19/10/16 19:23, Richard Biener wrote:
> 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.
Would excluding weak symbols (I believe I can check DECL_WEAK for this) 
good enough. Or looking for acceptable subset would work?

Thanks,
Kugan

>
> Richard.
>
>> 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.
>>
>

  reply	other threads:[~2016-10-19  8:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19  2:12 kugan
2016-10-19  8:24 ` Richard Biener
2016-10-19  8:48   ` kugan [this message]
2016-10-19  9:26     ` Richard Biener
2016-10-19 14:26       ` Jan Hubicka
2016-10-20  3:13         ` kugan
2016-10-20  7:42           ` Richard Biener
2016-10-20 11:56             ` kugan
2016-10-20 12:09               ` Richard Biener
2016-10-20 12:15               ` Jan Hubicka
2016-10-21  3:39                 ` kugan
2016-10-21  7:16                   ` Richard Biener
2016-10-21  7:38                     ` kugan
2016-10-21  8:08                       ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0987d0d3-9b7b-eeb8-cf2a-17d1d0df7f49@linaro.org \
    --to=kugan.vivekanandarajah@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).