may_alias attribute and type identity (PR c++/34935)
Mark Mitchell
mark@codesourcery.com
Thu Feb 7 15:57:00 GMT 2008
Richard Guenther wrote:
> I don't think that may_alias is an attribute that needs to be mangled, as its
> semantics affect code generation but not interfacing. For example:
>
> void foo(int *x __attribute__((may_alias));
>
> and
>
> void foo(int *x);
>
> are not distinguishable at the point of the caller -- but only affect code
> generation in foo() itself.
But only one direction of conversion makes sense implicitly: the usual
contra-variance applies. And, S<int *> and S<int *x
__attribute__((may_alias))> are different types, and therefore must be
mangled differently; you certainly can't assume silent conversion
between them.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc
mailing list