[PATCH] D31022: Implement P0298R3: `std::byte`

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 12:51:49 PDT 2017


FWIW, doesn't this just need a may_alias attribute on the definition?
On Wed, Jul 5, 2017 at 2:39 PM James Y Knight via Phabricator via
cfe-commits <cfe-commits at lists.llvm.org> wrote:

> jyknight added a comment.
>
> Ping. I don't think this got resolved, and I really wouldn't like to see
> released in this state...can you either revert this from the library, or
> implement the compiler support, before the 5.0 release branch?
>
> In https://reviews.llvm.org/D31022#716702, @jyknight wrote:
>
> > I believe this needs compiler support, too, in order to treat
> >
> >   namespace std { enum class byte : unsigned char {}; }
> >
> > as directly having tbaa type "omnipotent char" instead of a subtype.
> >
> > That is, given:
> >
> >   void foo(char* x, int *y) {
> >     x[1] = char(y[0] & 0xff);
> >     x[0] = char((y[0] & 0xff00) >> 8);
> >   }
> >
> > the compiler assumes that x and y might alias each-other, and thus must
> have two loads of y[0]. If you replace "char" with "std::byte", the same
> should happen, but as of now does not.
>
>
>
>
>
> https://reviews.llvm.org/D31022
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170705/d89fee8b/attachment.html>


More information about the cfe-commits mailing list