[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc
Subject: Re: Would alias analysis help WRT builtin memmove -> builtin memcpy ?
From: Jeffrey A Law <law () cygnus ! com>
Date: 2000-03-30 0:15:08
[Download RAW message or body]
In message <200003300012.TAA03981@caip.rutgers.edu>you write:
> I wasn't doing any casting, but the prototype of memmove may have done
> that for me.
No, a prototype will not do a cast. You would have to do the cast yourself.
> 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);
As I mentioned before, the aliasing code wants MEMs. You're not even really
supposed to be calling get_alias_set like that. You're supposed to be calling
stuff like true_dependence and the like (see alias.c).
jeff
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic