https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124019

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |tree-optimization
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=85234
           Severity|normal                      |enhancement
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-02-08

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. 

I think we should just have `(a << CST0) == CST1` as being Canonicalize to
`(a&CSTmask) == (CST1>>CST0)` on the gimple level. Shift is always always 
expensive than BIT_AND.



bool f2(int8_t a)
{
    int8_t b = a & 0xf;
    return b == 8;
}

Reply via email to