]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/117104 - add missed guards to max(a,b) != a simplification
authorRichard Biener <rguenther@suse.de>
Sat, 12 Oct 2024 12:51:37 +0000 (14:51 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 12 Oct 2024 15:04:31 +0000 (17:04 +0200)
commitf54d42e00007e7a558b273d87f95b3e5b1938f5a
treeedd7de0ce2e0fd0a9a6f93451bb030959ed98d53
parentba773a86f0377abccecd3e398dceb9408bba5a7c
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.
gcc/match.pd
gcc/testsuite/gcc.dg/pr117104.c [new file with mode: 0644]