On Sun, 4 Sep 2016, Bernd Edlinger wrote:

> good to have as well.  But this code would still be suspicious
> even if (x << y) is put in parentheses, because the shift count does
> not change the result of the condition, as the integer overflow is
> undefined behavior, and if it does not have side effects or does
> not throw something, it can even be optimized away.

It's defined in GNU C (when the shift count is nonnegative and less than 
the width of the type) - we document that we do not optimize on the basis 
of it being undefined (although ubsan will still detect it).

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

Reply via email to