aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 97c9f81..aa647de 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -12351,7 +12351,7 @@ lookup_binfo_at_offset (tree binfo, tree type, HOST_WIDE_INT pos)
found, return, otherwise return NULL_TREE. */
tree
-get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
+get_binfo_at_offset (tree binfo, poly_int64 offset, tree expected_type)
{
tree type = BINFO_TYPE (binfo);
@@ -12363,7 +12363,7 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
if (types_same_for_odr (type, expected_type))
return binfo;
- if (offset < 0)
+ if (maybe_lt (offset, 0))
return NULL_TREE;
for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
@@ -12373,7 +12373,7 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
pos = int_bit_position (fld);
size = tree_to_uhwi (DECL_SIZE (fld));
- if (pos <= offset && (pos + size) > offset)
+ if (known_in_range_p (offset, pos, size))
break;
}
if (!fld || TREE_CODE (TREE_TYPE (fld)) != RECORD_TYPE)
@@ -12381,7 +12381,7 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
/* Offset 0 indicates the primary base, whose vtable contents are
represented in the binfo for the derived class. */
- else if (offset != 0)
+ else if (maybe_ne (offset, 0))
{
tree found_binfo = NULL, base_binfo;
/* Offsets in BINFO are in bytes relative to the whole structure