From: Pan Li <pan2...@intel.com> Given all commutative binary operators requires types matching for both operands. Remove the types_match check for case 1 of the signed SAT_ADD, because we have (bit_xor @0 @1), which ensure the operands have the correct TREE type.
The below test suites are passed for this patch. * The rv64gcv fully regression test. * The x86 bootstrap test. * The x86 fully regression test. gcc/ChangeLog: * match.pd: Remove the types_match check for signed SAT_ADD case 1. Signed-off-by: Pan Li <pan2...@intel.com> --- gcc/match.pd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/match.pd b/gcc/match.pd index 4cef965c9c7..5566c0e4c41 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3204,8 +3204,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) integer_zerop) (bit_xor:c (negate (convert (lt @0 integer_zerop))) max_value) @2) - (if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type) - && types_match (type, @0, @1)))) + (if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type)))) /* Signed saturation add, case 2: T sum = (T)((UT)X + (UT)Y) -- 2.43.0