From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
To: law@cygnus.com
Cc: egcs@egcs.cygnus.com
Subject: Re: Would alias analysis help WRT builtin memmove -> builtin memcpy ?
Date: Wed, 29 Mar 2000 16:13:00 -0000 [thread overview]
Message-ID: <200003300012.TAA03981@caip.rutgers.edu> (raw)
> From: Jeffrey A Law <law@cygnus.com>
>
> In message < 200003292334.SAA02200@caip.rutgers.edu >you write:
> > Right, but then shouldn't it have returned set 0, not 11?
>
> Depends on the code :-) I believe if you had casted the arg to a void *
> then you would have got an alias set zero. Actually, wait, you have two
> pointers, not two MEMs -- how are you checking alias sets in that case
> since the alias set is a property of the MEM, not the address.
I wasn't doing any casting, but the prototype of memmove may have done
that for me.
Anway, here is what I am talking about. Assume the following is in a
new expand_builtin_memmove() routine, where `arglist' is the tree
chain of parameters passed to the expanded memmove call:
+ tree dst = TREE_VALUE (arglist);
+ tree src = TREE_VALUE (TREE_CHAIN (arglist));
+ tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
+ const int dst_set = get_alias_set (dst);
+ const int src_set = get_alias_set (src);
+ const int len_set = get_alias_set (len);
+
+ fprintf (stderr, "src=%d, dst=%d, len=%d\n",
+ src_set, dst_set, len_set);
+
+ if (src_set <= 0 || dst_set <= 0 || src_set == dst_set)
+ return 0;
+ else
+ return expand_builtin_memcpy (arglist);
Given a call to memmove(int[], char[], size_t) I was getting 11, 11, 9
for the alias sets. Maybe I'm not using the type based aliasing
correctly. (Docs somewhere?) In any case, I'm now interested in the
base ptr aliasing code.
> So, no, I don't see a way to do easily what you want since our aliasing
> code is designed to work on MEMs, not addresses.
>
> You might be able to generate a MEM with the unknown alias set (-1 I think)
> and pass that to the aliasing routines. Not really sure.
> jeff
Okay, what routine?
I couldn't figure out what the relevant exported interface to the base
ptr aliasing I should try. Randomly looking in alias.c wasn't very
productive.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
next reply other threads:[~2000-03-29 16:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-29 16:13 Kaveh R. Ghazi [this message]
2000-03-29 16:22 ` Jeffrey A Law
-- strict thread matches above, loose matches on Subject: below --
2000-03-29 15:34 Kaveh R. Ghazi
2000-03-29 15:44 ` Jeffrey A Law
2000-03-29 14:50 Kaveh R. Ghazi
2000-03-29 15:26 ` Jeffrey A Law
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=200003300012.TAA03981@caip.rutgers.edu \
--to=ghazi@caip.rutgers.edu \
--cc=egcs@egcs.cygnus.com \
--cc=law@cygnus.com \
/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).