On 9/10/23 20:18, Andrew Pinski via Gcc-patches wrote:
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.
OK jeff