]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Match: Remove unnecessary types_match for case 1 of signed SAT_ADD
authorPan Li <pan2.li@intel.com>
Fri, 13 Sep 2024 03:36:40 +0000 (11:36 +0800)
committerPan Li <pan2.li@intel.com>
Fri, 13 Sep 2024 09:14:56 +0000 (17:14 +0800)
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.li@intel.com>
gcc/match.pd

index 4cef965c9c7aeeb9a501da14a3f3afe7007c44b9..5566c0e4c41cc52e7c9be55eee836954e6755a7d 100644 (file)
@@ -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)