@@ -140,7 +140,7 @@ class operator_equal : public range_operator
140
140
const irange &rh) const final override ;
141
141
// Check op1 and op2 for compatibility.
142
142
bool operand_check_p (tree, tree t1, tree t2) const final override
143
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
143
+ { return range_compatible_p (t1, t2); }
144
144
};
145
145
146
146
class operator_not_equal : public range_operator
@@ -179,7 +179,7 @@ class operator_not_equal : public range_operator
179
179
const irange &rh) const final override ;
180
180
// Check op1 and op2 for compatibility.
181
181
bool operand_check_p (tree, tree t1, tree t2) const final override
182
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
182
+ { return range_compatible_p (t1, t2); }
183
183
};
184
184
185
185
class operator_lt : public range_operator
@@ -215,7 +215,7 @@ class operator_lt : public range_operator
215
215
const irange &rh) const final override ;
216
216
// Check op1 and op2 for compatibility.
217
217
bool operand_check_p (tree, tree t1, tree t2) const final override
218
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
218
+ { return range_compatible_p (t1, t2); }
219
219
};
220
220
221
221
class operator_le : public range_operator
@@ -254,7 +254,7 @@ class operator_le : public range_operator
254
254
const irange &rh) const final override ;
255
255
// Check op1 and op2 for compatibility.
256
256
bool operand_check_p (tree, tree t1, tree t2) const final override
257
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
257
+ { return range_compatible_p (t1, t2); }
258
258
};
259
259
260
260
class operator_gt : public range_operator
@@ -292,7 +292,7 @@ class operator_gt : public range_operator
292
292
const irange &rh) const final override ;
293
293
// Check op1 and op2 for compatibility.
294
294
bool operand_check_p (tree, tree t1, tree t2) const final override
295
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
295
+ { return range_compatible_p (t1, t2); }
296
296
};
297
297
298
298
class operator_ge : public range_operator
@@ -331,7 +331,7 @@ class operator_ge : public range_operator
331
331
const irange &rh) const final override ;
332
332
// Check op1 and op2 for compatibility.
333
333
bool operand_check_p (tree, tree t1, tree t2) const final override
334
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
334
+ { return range_compatible_p (t1, t2); }
335
335
};
336
336
337
337
class operator_identity : public range_operator
@@ -429,8 +429,7 @@ class operator_plus : public range_operator
429
429
relation_trio = TRIO_VARYING) const ;
430
430
// Check compatibility of all operands.
431
431
bool operand_check_p (tree t1, tree t2, tree t3) const final override
432
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
433
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
432
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
434
433
private:
435
434
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
436
435
const wide_int &lh_ub, const wide_int &rh_lb,
@@ -459,7 +458,7 @@ class operator_abs : public range_operator
459
458
const irange &rh) const final override ;
460
459
// Check compatibility of LHS and op1.
461
460
bool operand_check_p (tree t1, tree t2, tree) const final override
462
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
461
+ { return range_compatible_p (t1, t2); }
463
462
private:
464
463
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
465
464
const wide_int &lh_ub, const wide_int &rh_lb,
@@ -503,8 +502,7 @@ class operator_minus : public range_operator
503
502
relation_trio = TRIO_VARYING) const ;
504
503
// Check compatibility of all operands.
505
504
bool operand_check_p (tree t1, tree t2, tree t3) const final override
506
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
507
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
505
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
508
506
private:
509
507
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
510
508
const wide_int &lh_ub, const wide_int &rh_lb,
@@ -535,7 +533,7 @@ class operator_negate : public range_operator
535
533
relation_trio rel = TRIO_VARYING) const final override ;
536
534
// Check compatibility of LHS and op1.
537
535
bool operand_check_p (tree t1, tree t2, tree) const final override
538
- { return TYPE_PRECISION (t1) == TYPE_PRECISION ( t2); }
536
+ { return range_compatible_p (t1, t2); }
539
537
};
540
538
541
539
@@ -589,8 +587,7 @@ class operator_mult : public cross_product_operator
589
587
relation_trio = TRIO_VARYING) const ;
590
588
// Check compatibility of all operands.
591
589
bool operand_check_p (tree t1, tree t2, tree t3) const final override
592
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
593
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
590
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
594
591
};
595
592
596
593
class operator_addr_expr : public range_operator
@@ -621,8 +618,7 @@ class operator_bitwise_not : public range_operator
621
618
const irange &rh) const final override ;
622
619
// Check compatibility of all operands.
623
620
bool operand_check_p (tree t1, tree t2, tree t3) const final override
624
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
625
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
621
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
626
622
};
627
623
628
624
class operator_bitwise_xor : public range_operator
@@ -645,8 +641,7 @@ class operator_bitwise_xor : public range_operator
645
641
const irange &rh) const final override ;
646
642
// Check compatibility of all operands.
647
643
bool operand_check_p (tree t1, tree t2, tree t3) const final override
648
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
649
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
644
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
650
645
private:
651
646
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
652
647
const wide_int &lh_ub, const wide_int &rh_lb,
@@ -672,8 +667,7 @@ class operator_bitwise_and : public range_operator
672
667
const irange &rh) const override ;
673
668
// Check compatibility of all operands.
674
669
bool operand_check_p (tree t1, tree t2, tree t3) const final override
675
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
676
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
670
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
677
671
protected:
678
672
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
679
673
const wide_int &lh_ub, const wide_int &rh_lb,
@@ -698,8 +692,7 @@ class operator_bitwise_or : public range_operator
698
692
const irange &rh) const override ;
699
693
// Check compatibility of all operands.
700
694
bool operand_check_p (tree t1, tree t2, tree t3) const final override
701
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
702
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
695
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
703
696
protected:
704
697
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
705
698
const wide_int &lh_ub, const wide_int &rh_lb,
@@ -713,8 +706,7 @@ class operator_min : public range_operator
713
706
const irange &rh) const override ;
714
707
// Check compatibility of all operands.
715
708
bool operand_check_p (tree t1, tree t2, tree t3) const final override
716
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
717
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
709
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
718
710
protected:
719
711
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
720
712
const wide_int &lh_ub, const wide_int &rh_lb,
@@ -728,8 +720,7 @@ class operator_max : public range_operator
728
720
const irange &rh) const override ;
729
721
// Check compatibility of all operands.
730
722
bool operand_check_p (tree t1, tree t2, tree t3) const final override
731
- { return (TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
732
- && TYPE_PRECISION (t1) == TYPE_PRECISION (t3)); }
723
+ { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
733
724
protected:
734
725
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
735
726
const wide_int &lh_ub, const wide_int &rh_lb,
0 commit comments