return TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2);
}
+/* Routine to determine if the types T1, T2 and T3 are effectively
+ the same for GENERIC. If T1, T2 or T2 is not a type, the test
+ applies to their TREE_TYPE. */
+
+static inline bool
+types_match (tree t1, tree t2, tree t3)
+{
+ return types_match (t1, t2) && types_match (t2, t3);
+}
+
/* Return if T has a single use. For GENERIC, we assume this is
always true. */
return types_compatible_p (t1, t2);
}
+/* Routine to determine if the types T1, T2 and T3 are effectively
+ the same for GIMPLE. If T1, T2 or T2 is not a type, the test
+ applies to their TREE_TYPE. */
+
+static inline bool
+types_match (tree t1, tree t2, tree t3)
+{
+ return types_match (t1, t2) && types_match (t2, t3);
+}
+
/* Return if T has a single use. For GIMPLE, we also allow any
non-SSA_NAME (ie constants) and zero uses to cope with uses
that aren't linked up yet. */
/* Unsigned Saturation Add */
(match (usadd_left_part_1 @0 @1)
(plus:c @0 @1)
- (if (INTEGRAL_TYPE_P (type)
- && TYPE_UNSIGNED (TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@1)))))
+ (if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
+ && types_match (type, @0, @1))))
(match (usadd_left_part_2 @0 @1)
(realpart (IFN_ADD_OVERFLOW:c @0 @1))
- (if (INTEGRAL_TYPE_P (type)
- && TYPE_UNSIGNED (TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@1)))))
+ (if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
+ && types_match (type, @0, @1))))
(match (usadd_right_part_1 @0 @1)
(negate (convert (lt (plus:c @0 @1) @0)))
- (if (INTEGRAL_TYPE_P (type)
- && TYPE_UNSIGNED (TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@1)))))
+ (if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
+ && types_match (type, @0, @1))))
(match (usadd_right_part_1 @0 @1)
(negate (convert (gt @0 (plus:c @0 @1))))
- (if (INTEGRAL_TYPE_P (type)
- && TYPE_UNSIGNED (TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@1)))))
+ (if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
+ && types_match (type, @0, @1))))
(match (usadd_right_part_2 @0 @1)
(negate (convert (ne (imagpart (IFN_ADD_OVERFLOW:c @0 @1)) integer_zerop)))
- (if (INTEGRAL_TYPE_P (type)
- && TYPE_UNSIGNED (TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@0))
- && types_match (type, TREE_TYPE (@1)))))
+ (if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
+ && types_match (type, @0, @1))))
/* We cannot merge or overload usadd_left_part_1 and usadd_left_part_2
because the sub part of left_part_2 cannot work with right_part_1.