https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66703

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Yulia Koval from comment #2)
> Why zero-extend with and is better than zero-extend with movz? Why it's ok
> to clobber the flags?

According to Intel Pentium optimization guide, zero-extend with and is
faster than zero-extend with movz.  It is OK to clobber EFLAGS to do

unsigned int x = (unsigned int) b;

where b is a boolean value.

Reply via email to