[Bug tree-optimization/125442] Missed (x == 0) | ((x | y) == 0) to (x == 0)

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 25 02:24:28 GMT 2026


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-05-25
           Severity|normal                      |enhancement
     Ever confirmed|0                           |1

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Oh it is related to PR 117760 but slightly different.

There we supported:
(a == b) | ((a|b) == 0) -> (a == b)


But here we:
(a == 0) | ((a|b) == 0) -> (a == 0)


The other one which needs to be supported is:
(a != 0) & ((a|b) != 0) -> (a != 0)


More information about the Gcc-bugs mailing list