public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] cp: Actually use POINTER_DIFF_EXPR on capabilities
@ 2022-03-14 10:35 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2022-03-14 10:35 UTC (permalink / raw)
  To: gcc-cvs

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

commit fa47b6fb1ae5863a48aff3deca1476ff35a3a9a3
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Fri Feb 11 14:07:34 2022 +0000

    cp: Actually use POINTER_DIFF_EXPR on capabilities
    
    This is an analogous change to an earlier one made by Matthew for the C
    frontend (c57aaa70de51398205230d79a31ce869cca39ef3) which enables
    forming POINTER_DIFF_EXPR of capabilities in c-typeck.c:pointer_diff.
    
    gcc/cp/ChangeLog:
    
            * typeck.c (pointer_diff): Permit forming POINTER_DIFF_EXPR on
            capability operands directly.

Diff:
---
 gcc/cp/typeck.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 5b3be9b0faa..571e5ab36a9 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -6022,9 +6022,7 @@ pointer_diff (location_t loc, tree op0, tree op1, tree ptrtype,
      ptrdiff_type to support differences larger than half the address
      space, cast the pointers to some larger integer type and do the
      computations in that type.  */
-  if (TYPE_PRECISION (inttype) > calc_precision
-      || capability_type_p (TREE_TYPE (op0))
-      || capability_type_p (TREE_TYPE (op1)))
+  if (TYPE_PRECISION (inttype) > calc_precision)
     op0 = cp_build_binary_op (loc,
 			      MINUS_EXPR,
 			      cp_convert (inttype, op0, complain),


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

only message in thread, other threads:[~2022-03-14 10:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 10:35 [gcc(refs/vendors/ARM/heads/morello)] cp: Actually use POINTER_DIFF_EXPR on capabilities 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).