https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109959
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=104296 --- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- For the bothone: `(a > 1) ? 0 : a` could just be simplified to: `(cast)(a == 1)` For unsigned types. So: (simplify (cond (gt @0 integer_onep@1) integer_zerop (convert? @0)) (if (TYPE_UNSIGNED (TREE_TYPE (@0))) (convert (eq @0 @1)) ) ) Turns out the optional convert in the above will catch both cases.