https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106677
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-08-24 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > On the trunk we now get: > _25 = SR.116_117 == 0; > _27 = (unsigned char) _25; > _32 = _27 | SR.116_117; > > Rather than: > _119 = MAX_EXPR <1, SR.115_117>; > > But we should instead just get: > SR.116_117 | 1 > > Though that should still be transformed into 1 (will fix that seperately). > > I have a quick patch which fixes that, we need to move `a ? zero_one_value : > zero_one_value` part of match.pd below the min/max detection. The two patches for that. https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628405.html https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628404.html I have not looked into the rest but otherwise confirmed.