Date: Sat, 4 May 2019 12:11:39 +0100
> My conjecture (real information welcome!) is that current compilers tend
> to conflate compiler optimization facts like "*a aliases *b" or "a and b
> point to the same thing" with the result of the expression "a == b". The
> current standard sanctions this, but fundamentally they're not the same.
> When the compiler asks aliasing questions, it generally wants to know
> whether an update through one pointer could affect the value pointed to
> by the other. It doesn't care what answer it gets if either side cannot
> be safely dereferenced. We now have lots of examples where user code
> does care about that case.
I find this a very helpful conjecture which does appear to fit
observations. It would be useful if the clang devs could confirm or deny it.
Niall
> to conflate compiler optimization facts like "*a aliases *b" or "a and b
> point to the same thing" with the result of the expression "a == b". The
> current standard sanctions this, but fundamentally they're not the same.
> When the compiler asks aliasing questions, it generally wants to know
> whether an update through one pointer could affect the value pointed to
> by the other. It doesn't care what answer it gets if either side cannot
> be safely dereferenced. We now have lots of examples where user code
> does care about that case.
I find this a very helpful conjecture which does appear to fit
observations. It would be useful if the clang devs could confirm or deny it.
Niall
Received on 2019-05-04 06:13:43