From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7810) id 990ED382F091; Fri, 20 May 2022 12:34:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 990ED382F091 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alex Coplan To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] morello: Adjust odr_types_equivalent_p for capabilities X-Act-Checkin: gcc X-Git-Author: Alex Coplan X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 291268154c24266ac510e8606b0466d56ff1a8d5 X-Git-Newrev: 68235c7e93261efd4be7f6a0e9a9d005b412880a Message-Id: <20220520123416.990ED382F091@sourceware.org> Date: Fri, 20 May 2022 12:34:16 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2022 12:34:16 -0000 https://gcc.gnu.org/g:68235c7e93261efd4be7f6a0e9a9d005b412880a commit 68235c7e93261efd4be7f6a0e9a9d005b412880a Author: Alex Coplan 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 "