https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115275
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:b085fc9965b7d1e99725892587682822068f2baa commit r15-5356-gb085fc9965b7d1e99725892587682822068f2baa Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Fri Nov 15 23:20:42 2024 -0800 match: Optimize `max(a,b) == 0` to `(a|b) == 0` for unsigned [PR115275] For unsigned types, you can optimize `max<a,b> == 0` into `(a|b) == 0` (that is both have to be zero). A similar thing happens for `!= 0`. This optimization fixes the missed optimization (g++.dg/tree-ssa/pr115275.C) that was reported exposed by adding phiprop early. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/115275 gcc/ChangeLog: * match.pd (umax(a,b) ==/!= 0): New pattern. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/pr115275.C: New test. * gcc.dg/tree-ssa/max_eqne-1.c: New test. * gcc.dg/tree-ssa/max_eqne-2.c: New test. Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>