https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110539
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |110293 --- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > # RANGE [irange] int [0, 1] NONZERO 0x1 > i_7 = a.0_1 & 1; > > _17 = i_7 != 0; > _12 = (int) _17; > if (i_7 == _12) Wait that is: i_7 == (convert) (i_7 != 0); Which is basically PR 110293. So there is another way of fixing this is simplifying `i_7 == (convert) (i_7 != 0)` into `(unsigned_type)i_7 <= 1` and that is always true as `(a.0_1 & 1) <= 1` is always true. Let me try fixing PR 110293 as the way of fixing this one instead of the patch which I submitted but has other issues. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 [Bug 110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases