aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-11 22:51:28 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-11 22:51:28 +0100
commita95e21151a6366e7344d0f1983f99e318c5a7097 (patch)
tree11d987406d9ce8399ec1736477d971ef09344df2 /gcc/tree.h
parent02d394b2736afa9a24ab3e1b8ad56fd6ac37e0f4 (diff)
parentaf4bb221153359f5948da917d5ef2df738bb1e61 (diff)
downloadgcc-a95e21151a6366e7344d0f1983f99e318c5a7097.zip
gcc-a95e21151a6366e7344d0f1983f99e318c5a7097.tar.gz
gcc-a95e21151a6366e7344d0f1983f99e318c5a7097.tar.bz2
Merge commit 'af4bb221153359f5948da917d5ef2df738bb1e61' into HEAD
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h46
1 files changed, 35 insertions, 11 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 54cf828..31ea52a 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1139,8 +1139,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
(INTEGER_CST_CHECK (NODE)->base.u.int_length.unextended)
#define TREE_INT_CST_EXT_NUNITS(NODE) \
(INTEGER_CST_CHECK (NODE)->base.u.int_length.extended)
-#define TREE_INT_CST_OFFSET_NUNITS(NODE) \
- (INTEGER_CST_CHECK (NODE)->base.u.int_length.offset)
#define TREE_INT_CST_ELT(NODE, I) TREE_INT_CST_ELT_CHECK (NODE, I)
#define TREE_INT_CST_LOW(NODE) \
((unsigned HOST_WIDE_INT) TREE_INT_CST_ELT (NODE, 0))
@@ -4974,7 +4972,7 @@ extern tree max_object_size ();
without loss of precision. Store the value in *VALUE if so. */
inline bool
-poly_int_tree_p (const_tree t, poly_int64_pod *value)
+poly_int_tree_p (const_tree t, poly_int64 *value)
{
if (tree_fits_poly_int64_p (t))
{
@@ -4988,7 +4986,7 @@ poly_int_tree_p (const_tree t, poly_int64_pod *value)
without loss of precision. Store the value in *VALUE if so. */
inline bool
-poly_int_tree_p (const_tree t, poly_uint64_pod *value)
+poly_int_tree_p (const_tree t, poly_uint64 *value)
{
if (tree_fits_poly_uint64_p (t))
{
@@ -5617,7 +5615,7 @@ bit_field_offset (const_tree t)
extern tree strip_float_extensions (tree);
extern bool really_constant_p (const_tree);
-extern bool ptrdiff_tree_p (const_tree, poly_int64_pod *);
+extern bool ptrdiff_tree_p (const_tree, poly_int64 *);
extern bool decl_address_invariant_p (const_tree);
extern bool decl_address_ip_invariant_p (const_tree);
extern bool int_fits_type_p (const_tree, const_tree)
@@ -6237,6 +6235,7 @@ namespace wi
static const enum precision_type precision_type = VAR_PRECISION;
static const bool host_dependent_precision = false;
static const bool is_sign_extended = false;
+ static const bool needs_write_val_arg = false;
};
template <int N>
@@ -6258,13 +6257,15 @@ namespace wi
template <int N>
struct int_traits <extended_tree <N> >
{
- static const enum precision_type precision_type = CONST_PRECISION;
+ static const enum precision_type precision_type
+ = N == ADDR_MAX_PRECISION ? INL_CONST_PRECISION : CONST_PRECISION;
static const bool host_dependent_precision = false;
static const bool is_sign_extended = true;
+ static const bool needs_write_val_arg = false;
static const unsigned int precision = N;
};
- typedef extended_tree <WIDE_INT_MAX_PRECISION> widest_extended_tree;
+ typedef extended_tree <WIDEST_INT_MAX_PRECISION> widest_extended_tree;
typedef extended_tree <ADDR_MAX_PRECISION> offset_extended_tree;
typedef const generic_wide_int <widest_extended_tree> tree_to_widest_ref;
@@ -6292,6 +6293,13 @@ namespace wi
tree_to_poly_wide_ref to_poly_wide (const_tree);
template <int N>
+ struct ints_for <generic_wide_int <extended_tree <N> >, INL_CONST_PRECISION>
+ {
+ typedef generic_wide_int <extended_tree <N> > extended;
+ static extended zero (const extended &);
+ };
+
+ template <int N>
struct ints_for <generic_wide_int <extended_tree <N> >, CONST_PRECISION>
{
typedef generic_wide_int <extended_tree <N> > extended;
@@ -6308,7 +6316,7 @@ namespace wi
/* Used to convert a tree to a widest2_int like this:
widest2_int foo = widest2_int_cst (some_tree). */
-typedef generic_wide_int <wi::extended_tree <WIDE_INT_MAX_PRECISION * 2> >
+typedef generic_wide_int <wi::extended_tree <WIDEST_INT_MAX_PRECISION * 2> >
widest2_int_cst;
/* Refer to INTEGER_CST T as though it were a widest_int.
@@ -6443,8 +6451,16 @@ inline unsigned int
wi::extended_tree <N>::get_len () const
{
if (N == ADDR_MAX_PRECISION)
- return TREE_INT_CST_OFFSET_NUNITS (m_t);
- else if (N >= WIDE_INT_MAX_PRECISION)
+ {
+ /* to_offset can only be applied to trees that are offset_int-sized
+ or smaller. EXT_LEN is correct if it fits, otherwise the constant
+ must be exactly the precision of offset_int and so LEN is correct. */
+ unsigned int ext_len = TREE_INT_CST_EXT_NUNITS (m_t);
+ if (ext_len <= OFFSET_INT_ELTS)
+ return ext_len;
+ return TREE_INT_CST_NUNITS (m_t);
+ }
+ else if (N >= WIDEST_INT_MAX_PRECISION)
return TREE_INT_CST_EXT_NUNITS (m_t);
else
/* This class is designed to be used for specific output precisions
@@ -6530,6 +6546,14 @@ wi::to_poly_wide (const_tree t)
template <int N>
inline generic_wide_int <wi::extended_tree <N> >
wi::ints_for <generic_wide_int <wi::extended_tree <N> >,
+ wi::INL_CONST_PRECISION>::zero (const extended &x)
+{
+ return build_zero_cst (TREE_TYPE (x.get_tree ()));
+}
+
+template <int N>
+inline generic_wide_int <wi::extended_tree <N> >
+wi::ints_for <generic_wide_int <wi::extended_tree <N> >,
wi::CONST_PRECISION>::zero (const extended &x)
{
return build_zero_cst (TREE_TYPE (x.get_tree ()));
@@ -6637,7 +6661,7 @@ extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree);
/* Given an expression EXP that is a handled_component_p,
look for the ultimate containing object, which is returned and specify
the access position and size. */
-extern tree get_inner_reference (tree, poly_int64_pod *, poly_int64_pod *,
+extern tree get_inner_reference (tree, poly_int64 *, poly_int64 *,
tree *, machine_mode *, int *, int *, int *);
extern tree build_personality_function (const char *);