This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Aliasing violation generated by fold_builtin_memcmp?
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 30 Sep 2005 11:30:57 -0400
- Subject: Re: Aliasing violation generated by fold_builtin_memcmp?
- References: <10509301520.AA18214@vlsi1.ultra.nyu.edu>
On Fri, 2005-09-30 at 11:20 -0400, Richard Kenner wrote:
> Uh, CAN_ALIAS_ALL seems like a very bad hack then.
> You should simply be creating a pointed-to type that aliases set 0, and
> using that for the pointed to type.
> That is, after all, what alias set 0 is for.
>
> That's easy enough for integer types, but creating multiple record types
> means duplicating lots of fields and layouts and is, in general, a mess.
But of course, it's the right thing to do when you've got one type that
can be aliased to anything through a pointer, and the other cannot.
> What's special here is the pointer type, not the underlying type.
Which means that everywhere that handles pointer types and aliasing has
to be modified to check this magic.
I still claim it is a hack, and a very bad one.
At the absolute least, it should be encapsulated in a function, maybe
"get_alias_set_of_pointed_to_type" or something.
--Dan