https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111349
--- Comment #2 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:b59e9de990a17bfd5fa7252b76339c35bff7f2e8 commit r14-3842-gb59e9de990a17bfd5fa7252b76339c35bff7f2e8 Author: Andrew Pinski <apin...@marvell.com> Date: Sun Sep 10 21:58:12 2023 -0700 MATCH: [PR111349] add missing :c to cmp in the `(a CMP CST1) ? max<a,CST2> : a` pattern When I added this pattern in r14-1411-g17cca3c43e2f49, I had missed the :c on the cmp part of the pattern meaning there might be some missing optimizations happening. The testcase shows an example of the missed optmization. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR tree-optimization/111349 gcc/ChangeLog: * match.pd (`(a CMP CST1) ? max<a,CST2> : a`): Add :c on the cmp part of the pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/minmax-25.c: New test.