#include "ssa.h"
#include "tree-pretty-print.h"
#include "fold-const.h"
+#include "gimple-range.h"
// Here we copy between any two irange's. The ranges can be legacy or
// multi-ranges, and copying between any combination works correctly.
if (m_kind != other.m_kind)
return false;
- if (m_kind == VR_UNDEFINED || m_kind == VR_VARYING)
+ if (m_kind == VR_UNDEFINED)
return true;
+ if (m_kind == VR_VARYING)
+ return range_compatible_p (type (), other.type ());
return (vrp_operand_equal_p (tree_lower_bound (0),
other.tree_lower_bound (0))
&& vrp_operand_equal_p (tree_upper_bound (0),
copy = legacy_range;
ASSERT_TRUE (copy.varying_p ());
}
+
+ // VARYING of different sizes should not be equal.
+ int_range_max r0 (integer_type_node);
+ int_range_max r1 (short_integer_type_node);
+ ASSERT_TRUE (r0 != r1);
+ value_range vr0 (integer_type_node);
+ int_range_max vr1 (short_integer_type_node);
+ ASSERT_TRUE (vr0 != vr1);
}
// Simulate -fstrict-enums where the domain of a type is less than the