On April 5, 2017 3:28:32 PM GMT+02:00, Jakub Jelinek <ja...@redhat.com> wrote: >On Wed, Apr 05, 2017 at 09:46:09AM +0000, Bernd Edlinger wrote: >> this is related to the P1 codegen bug PR79671: >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79671 >> >> Therefore I would like to add this now although >> the trunk is already at in stage 4. >> >> I propose to add a new type attribute always_alias that >> works like may_alias but unlike may_alias it should >> also make instances alias anything. It is also exposed >> in C/C++ as __attribute__((always_alias)). > >I have just two small comments, for review IMHO want agreement >between Jason and Richard on this. > >One thing is whether it is a good idea to keep this info in the IL >as an attribute, especially when you add it automatically in the >C++ FE. I see e.g. 25 spare bits in tree_type_common. Don't say we >need to waste them, but I'd say in C++ unsigned char arrays are fairly >common and thus not having to create the attribute for them each time >and look it up might be beneficial.
Agreed. >Also, wonder if you need to mark all types containing such arrays, >if you couldn't just set that flag in C++ on unsigned char/std::byte >arrays (and on anything with that attribute), have that imply alias set >0 on it and then let the rest of alias machinery handle aggregate types >containing such fields. Yes, I expected it to work like this (didn't look at the patch yet). Richard. > Jakub