Annoying silly warning emitted by gcc?
Joseph Myers
joseph@codesourcery.com
Thu Jan 24 01:25:00 GMT 2019
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
joseph@codesourcery.com
More information about the Gcc
mailing list