RFC (attributes): PATCH for c++/50800 to set affects_type_identity for may_alias
Jason Merrill
jason@redhat.com
Thu Jun 23 19:39:00 GMT 2016
My earlier patch for 50800 fixed the ICE by consistently stripping
non-mangled attributes from template arguments, and mangling those that
affect type identity. At the C++ meeting this week someone pointed out
to me that this is a real problem for x86 vector code, which relies on
may_alias semantics: if may_alias is stripped from __m128, users can't
use templates with vectors.
So, it seems that the solution is to mangle may_alias by saying that it
affects type identity. But since we still want to be able to convert
back and forth, I thought that it would make sense to treat the
may_alias version of a type as a variant, rather than a new distinct
type. So the first patch creates a new category of attributes that are
treated as type variants.
An alternative patch just sets affects_type_identity and adjusts the C++
front end to allow conversion between pointers to add or discard may_alias.
Thoughts?
Tested x86_64-pc-linux-gnu.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: may_alias-be.diff
Type: text/x-patch
Size: 14127 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160623/faac168b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: may_alias-fe.diff
Type: text/x-patch
Size: 6001 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160623/faac168b/attachment-0001.bin>
More information about the Gcc-patches
mailing list