public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Alex Coplan <acoplan@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] morello: Adjust odr_types_equivalent_p for capabilities Date: Fri, 20 May 2022 12:34:16 +0000 (GMT) [thread overview] Message-ID: <20220520123416.990ED382F091@sourceware.org> (raw) 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 "
reply other threads:[~2022-05-20 12:34 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220520123416.990ED382F091@sourceware.org \ --to=acoplan@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).