https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111364
--- Comment #6 from CVS 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:06bedc3860d3e61857d72ffe699f79ed5c92855f commit r14-3922-g06bedc3860d3e61857d72ffe699f79ed5c92855f Author: Andrew Pinski <apin...@marvell.com> Date: Tue Sep 12 05:16:06 2023 +0000 MATCH: [PR111364] Add some more minmax cmp operand simplifications This adds a few more minmax cmp operand simplifications which were missed before. `MIN(a,b) < a` -> `a > b` `MIN(a,b) >= a` -> `a <= b` `MAX(a,b) > a` -> `a < b` `MAX(a,b) <= a` -> `a >= b` OK? Bootstrapped and tested on x86_64-linux-gnu. Note gcc.dg/pr96708-negative.c needed to updated to remove the check for MIN/MAX as they have been optimized (correctly) away. PR tree-optimization/111364 gcc/ChangeLog: * match.pd (`MIN (X, Y) == X`): Extend to min/lt, min/ge, max/gt, max/le. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/minmaxcmp-1.c: New test. * gcc.dg/tree-ssa/minmaxcmp-2.c: New test. * gcc.dg/pr96708-negative.c: Update testcase. * gcc.dg/pr96708-positive.c: Add comment about `return 0`.