https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105314
--- Comment #8 from Christoph Müllner <christophm30 at gmail dot com> --- Yes, I was wrong in my previous comment. Jakub's patch is of course right. The transformation in noce_try_store_flag_mask() does: x = cond ? 0 else b // b may be x ==> target = cond ? 0 : -1; // seqz & neg x = target & b; // and I was misled by the comment above the function, which only shows the special case when b equals x. Probably this is a better comment: /* Convert "if (test) x = 0 else x = y;" to "x = -(test == 0) & y;" */