Here we update the simple scalar case of odr_types_equivalent_p to also
handle INTCAP_TYPEs and use TYPE_CAP_PRECISION when checking for
precision mismatches. If the types disagree on their TYPE_CAP_PRECISION
(e.g. if one is a capability pointer and the other is a non-capability
pointer), then they cannot be ODR equivalent.
gcc/ChangeLog:
* ipa-devirt.c (odr_types_equivalent_p): Also handle
INTCAP_TYPE, use TYPE_CAP_PRECISION in scalar base case.
/* Non-aggregate types can be handled cheaply. */
if (INTEGRAL_TYPE_P (t1)
+ || INTCAP_TYPE_P (t1)
|| SCALAR_FLOAT_TYPE_P (t1)
|| FIXED_POINT_TYPE_P (t1)
|| TREE_CODE (t1) == VECTOR_TYPE
|| TREE_CODE (t1) == OFFSET_TYPE
|| POINTER_TYPE_P (t1))
{
- if (TYPE_PRECISION (t1) != TYPE_PRECISION (t2))
+ if (TYPE_CAP_PRECISION (t1) != TYPE_CAP_PRECISION (t2))
{
warn_odr (t1, t2, NULL, NULL, warn, warned,
G_("a type with different precision is defined "