[PATCH] Repair TYPE_REF_CAN_ALIAS_ALL machinery

Richard Guenther richard.guenther@gmail.com
Mon May 22 13:30:00 GMT 2006


On 5/22/06, Richard Kenner <kenner@vlsi1.ultra.nyu.edu> wrote:
>     As a general statement, we shouldn't need TYPE_REF_CAN_ALIAS_ALL, we
>     handle the same thing in other languages without it.
>
> No.  Other languages don't have that concept.  In C, (char *) is presumed
> to alias to everything, but that's (as has been said) really an attribute
> of "char", not the pointer: *all* pointers to char behave that way.
>
> In Ada, we have the situation where we have a type T and most pointers to
> T are fine, but *one particular* type that points to T has this behavior.
> That's a very different model.

Gigi could create a union with the two pointed-to types for this case and expose
the casted to pointer as a pointer to that union to the middle-end.
Now, if it's worth
the hassle is another question.

Richard.



More information about the Gcc-patches mailing list