https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88575
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Macleod <amacl...@gcc.gnu.org>: https://gcc.gnu.org/g:b0eeb540497c7b9dee01f8724f9a4978b53a12ae commit r15-6815-gb0eeb540497c7b9dee01f8724f9a4978b53a12ae Author: Andrew MacLeod <amacl...@redhat.com> Date: Fri Jan 10 13:33:01 2025 -0500 Use relations when simplifying MIN and MAX. Query for known relations between the operands, and pass that to fold_range to help simplify MIN and MAX relations. Make it type agnostic as well. Adapt testcases from DOM to EVRP (e suffix) and test floats (f suffix). PR tree-optimization/88575 gcc/ * vr-values.cc (simplify_using_ranges::fold_cond_with_ops): Query relation between op0 and op1 and utilize it. (simplify_using_ranges::simplify): Do not eliminate float checks. gcc/testsuite/ * gcc.dg/tree-ssa/minmax-27.c: Disable VRP. * gcc.dg/tree-ssa/minmax-27e.c: New. * gcc.dg/tree-ssa/minmax-27f.c: New. * gcc.dg/tree-ssa/minmax-28.c: Disable VRP. * gcc.dg/tree-ssa/minmax-28e.c: New. * gcc.dg/tree-ssa/minmax-28f.c: New.