This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add a new type attribute always_alias (PR79671)


On 04/05/17 17:20, Richard Biener wrote:
>> 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).
>

I want to allow *only* what the C++ standard requires or what Jason says
of course :), and not a single bit more, because it suppresses otherwise
correct optimizations.

So a struct with a std::byte member is not alias_set 0,
only the std::byte itself is, but an array of std::byte
is itself typeless_storage, and makes the whole structure
also typeless_storage, but that is not the usual way how
the alias machinery works, where such an attribute would not
propagate.  Currently I think the C++ FE can do the propagation
when the type is declared.  I would not imply that with the
typeless_storage attribute, because may_alias does not do that
either.


Bernd.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]