On Wed, 23 Jan 2019, Warren D Smith wrote:

> x = x^x;
> 
> The purpose of the above is to load "x" with zero.
> For very wide types, say 256 bits wide, explicitly loading 0
> is deprecated by Intel since taking too much memory.
> XORing x with itself always yields 0 and is allegedly
> a better thing to do.

There is widespread support in WG14 for C semantics being uninitialized 
values being unstable, so that there is no need for the two reads of x to 
return the same value and x^x is also an unspecified value.  See e.g. 
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2221.htm>.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to