]> gcc.gnu.org Git - gcc.git/commitdiff
morello: Adjust odr_types_equivalent_p for capabilities
authorAlex Coplan <alex.coplan@arm.com>
Fri, 18 Mar 2022 11:49:28 +0000 (11:49 +0000)
committerAlex Coplan <alex.coplan@arm.com>
Fri, 20 May 2022 10:52:09 +0000 (11:52 +0100)
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.

gcc/ipa-devirt.c

index 696250c72083902c7e53e0e134f61213b4b14fe3..1618761af294d135d0001fd14d2b96d6c82641c1 100644 (file)
@@ -1233,6 +1233,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
 
   /* 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
@@ -1240,7 +1241,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
       || 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 "
This page took 0.063385 seconds and 5 git commands to generate.