https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86891
--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> --- Yes, the extension should be zero-extend, not sign extend. The plus operation is correct, however, since decrementing the first operand could lead to underflow if it was zero. So the correct rtl would be (compare ((zero_x(a)) (plus (zero_x(b) (ltu(cc, 0))))) (minus (...))