public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] cp_build_c_cast: TYPE_PRECISION fix
@ 2022-02-28 12:09 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2022-02-28 12:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c765078578688e8a16e6632c7180b0b2389ccd55

commit c765078578688e8a16e6632c7180b0b2389ccd55
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Fri Jan 28 10:44:41 2022 +0000

    cp_build_c_cast: TYPE_PRECISION fix
    
    Use TYPE_NONCAP_PRECISION to compare the precision of the capabilities'
    address values with the precision of the integer from which we're
    casting.

Diff:
---
 gcc/cp/typeck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index ac30f4b4133..5de36ddf0ce 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -8299,7 +8299,7 @@ cp_build_c_cast (location_t loc, tree type, tree expr,
   if (TYPE_PTR_P (type)
       && TREE_CODE (TREE_TYPE (value)) == INTEGER_TYPE
       /* Casting to an integer of smaller size is an error detected elsewhere.  */
-      && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (value))
+      && TYPE_NONCAP_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (value))
       /* Don't warn about converting any constant.  */
       && !TREE_CONSTANT (value))
     warning_at (loc, OPT_Wint_to_pointer_cast,


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

only message in thread, other threads:[~2022-02-28 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 12:09 [gcc(refs/vendors/ARM/heads/morello)] cp_build_c_cast: TYPE_PRECISION fix Matthew Malcomson

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).