https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111346
--- Comment #5 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:190cf0ce8f4c141ac5b42d53b9ddeba367495333 commit r14-3832-g190cf0ce8f4c141ac5b42d53b9ddeba367495333 Author: Andrew Pinski <apin...@marvell.com> Date: Sun Sep 10 15:59:41 2023 -0700 MATCH: [PR111346] `X CMP MINMAX` pattern missing :c on CMP I noticed this while working on other MINMAX optimizations. It was hard to find a simplified testcase though because it was dependent on the ssa name versions. Adding the `:c` to cmp allows the pattern to be match for the case where minmax as the first operand of the comparison rather than the second. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR tree-optimization/111346 gcc/ChangeLog: * match.pd (`X CMP MINMAX`): Add `:c` on the cmp part of the pattern gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/minmaxcmp-1.c: New test.