https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109401
--- Comment #7 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:5eadc673366c68a62264c55a570cbdfca96bbbaa commit r15-5355-g5eadc673366c68a62264c55a570cbdfca96bbbaa Author: Eikansh Gupta <quic_eikag...@quicinc.com> Date: Mon Nov 11 17:25:45 2024 +0530 MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401] This patch simplify `min(a,b) op max(a,b)` to `a op b`. This optimization will work for all the binary commutative operations. So, the `op` here can be one of {plus, mult, bit_and, bit_xor, bit_ior, eq, ne, min, max}. PR tree-optimization/109401 gcc/ChangeLog: * match.pd (min(a,b) op max(a,b) -> a op b): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr109401.c: New test. * gcc.dg/tree-ssa/pr109401-1.c: New test. Signed-off-by: Eikansh Gupta <quic_eikag...@quicinc.com>