From: Richard Biener <rguenther@suse.de>
To: Tom de Vries <Tom_deVries@mentor.com>
Cc: "gcc-patches@gnu.org" <gcc-patches@gnu.org>
Subject: Re: [PATCH][PR67671] Handle restrict pointer references as restrict in AA
Date: Tue, 22 Sep 2015 14:12:00 -0000 [thread overview]
Message-ID: <alpine.LSU.2.11.1509221602110.24931@zhemvz.fhfr.qr> (raw)
In-Reply-To: <56013E8C.5060703@mentor.com>
On Tue, 22 Sep 2015, Tom de Vries wrote:
> Hi,
>
> Consider this test-case:
> ...
> struct ps
> {
> int *__restrict__ p;
> };
>
> f (struct ps &__restrict__ ps1)
> {
> *(ps1.p) = 1;
> }
> ...
>
> Atm (meaning after the fix for PR67666) for this test-case, we register two
> clique/base annotations, one for the load of pointer ps1.p and one for the
> store to that pointer:
> ...
> void f(ps&) (struct psD.2252 & restrict ps1D.2255)
> {
> intD.9 * _3;
>
> # VUSE <.MEM_1(D)>
> # PT = { D.2262 } (nonlocal)
> _3 = MEM[(struct psD.2252 &)ps1_2(D) clique 1 base 1].pD.2254;
>
> # .MEM_4 = VDEF <.MEM_1(D)>
> MEM[(intD.9 *)_3 clique 1 base 2] = 1;
> ...
>
>
> If we rewrite the test-case by replacing the struct with its only field, we
> get:
> ...
> f (int *__restrict__ &__restrict__ p)
> {
> *p = 1;
> }
> ...
>
> However, in this case, we register only one clique/base annotation, for the
> load of pointer p, but not for the store to pointer p:
> ...
> void f(int* __restrict__&) (intD.9 * restrict & restrict pD.2255)
> {
> intD.9 * _3;
>
> # VUSE <.MEM_1(D)>
> # PT = nonlocal escaped
> _3 = MEM[(intD.9 * restrict &)p_2(D) clique 1 base 1];
>
> # .MEM_4 = VDEF <.MEM_1(D)>
> *_3 = 1;
> ...
>
>
> This patch makes sure we register both clique/base annotations for the the
> second example.
>
> Bootstrapped and reg-tested on x86_64.
>
> OK for trunk?
Ok.
Thanks,
Richard.
> Thanks,
> - Tom
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)
next prev parent reply other threads:[~2015-09-22 14:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 12:17 Tom de Vries
2015-09-22 14:12 ` Richard Biener [this message]
2015-10-23 12:12 ` [PATCH] Remove superfluous code in intra_create_variable_infos Tom de Vries
2015-10-23 12:51 ` 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=alpine.LSU.2.11.1509221602110.24931@zhemvz.fhfr.qr \
--to=rguenther@suse.de \
--cc=Tom_deVries@mentor.com \
--cc=gcc-patches@gnu.org \
/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).