Stream: t-lang/wg-unsafe-code-guidelines

Topic: LLVM noalias docs update

RalfJ (Feb 26 2020 at 16:34, on Zulip):

I just saw this:
If I read it correct this is fine for us (it is, in fact, how we interpreted noalias all along for shared references), but more eyes can't hurt. ;)
Also I am surprised they say this matches C; it's news to me that C restrict permits read-read aliasing. I'll have to dig out the relevant part of the standard again.

Hanna Kruppe (Feb 26 2020 at 17:21, on Zulip):

I haven't thought as deeply about it but yes, my impression when I read it was also that this change blesses the way we've always used noalias for shared references (absent UnsafeCell)

cuviper (Feb 27 2020 at 02:09, on Zulip):

I think our interpretation was already justified this way:

For further details, please see the discussion of the NoAlias response in alias analysis.

which gives an example:

when the two pointers are only ever used for reading memory.

RalfJ (Feb 27 2020 at 08:59, on Zulip):

re: C's restrict, indeed the standard says

If L is used to access the value of the object X that it designates, and X is also modified (by any means), then

Good to know, I wasn't aware read-only aliasing was allowed for restrict.

Last update: Jun 05 2020 at 23:10UTC