public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] morello: Adjust odr_types_equivalent_p for capabilities
@ 2022-05-20 12:34 Alex Coplan
  0 siblings, 0 replies; only message in thread
From: Alex Coplan @ 2022-05-20 12:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:68235c7e93261efd4be7f6a0e9a9d005b412880a

commit 68235c7e93261efd4be7f6a0e9a9d005b412880a
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Fri Mar 18 11:49:28 2022 +0000

    morello: Adjust odr_types_equivalent_p for capabilities
    
    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.

Diff:
---
 gcc/ipa-devirt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 696250c7208..1618761af29 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -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 "


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-20 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 12:34 [gcc(refs/vendors/ARM/heads/morello)] morello: Adjust odr_types_equivalent_p for capabilities Alex Coplan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).