https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117104
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:72d7bdbdd9fe1e575b7ad6da0fd7587627912ddb commit r12-10910-g72d7bdbdd9fe1e575b7ad6da0fd7587627912ddb Author: Richard Biener <rguent...@suse.de> Date: Sat Oct 12 14:51:37 2024 +0200 tree-optimization/117104 - add missed guards to max(a,b) != a simplification For vector types we have to make sure the comparison result is a vector type and the resulting compare operation is supported. As the resulting compare is never an equality compare I didn't bother to check for the cbranch case. PR tree-optimization/117104 * match.pd ((cmp:c (minmax:c @0 @1) @0) -> (out @0 @1)): Properly guard the vector case. * gcc.dg/pr117104.c: New testcase. (cherry picked from commit f54d42e00007e7a558b273d87f95b3e5b1938f5a)