aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 84d10a0..97fb4c6 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "target.h"
#include "cgraph.h"
+#include "wide-int.h"
/* Debugging support. */
@@ -1513,8 +1514,8 @@ static inline void
write_integer_cst (const tree cst)
{
int sign = tree_int_cst_sgn (cst);
-
- if (TREE_INT_CST_HIGH (cst) + (sign < 0))
+ widest_int abs_value = wi::abs (wi::to_widest (cst));
+ if (!wi::fits_uhwi_p (abs_value))
{
/* A bignum. We do this in chunks, each of which fits in a
HOST_WIDE_INT. */
@@ -1540,8 +1541,7 @@ write_integer_cst (const tree cst)
type = c_common_signed_or_unsigned_type (1, TREE_TYPE (cst));
base = build_int_cstu (type, chunk);
- n = build_int_cst_wide (type,
- TREE_INT_CST_LOW (cst), TREE_INT_CST_HIGH (cst));
+ n = wide_int_to_tree (type, cst);
if (sign < 0)
{
@@ -1568,14 +1568,9 @@ write_integer_cst (const tree cst)
else
{
/* A small num. */
- unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (cst);
-
if (sign < 0)
- {
- write_char ('n');
- low = -low;
- }
- write_unsigned_number (low);
+ write_char ('n');
+ write_unsigned_number (abs_value.to_uhwi ());
}
}
@@ -3226,12 +3221,12 @@ write_array_type (const tree type)
{
/* The ABI specifies that we should mangle the number of
elements in the array, not the largest allowed index. */
- double_int dmax = tree_to_double_int (max) + double_int_one;
+ offset_int wmax = wi::to_offset (max) + 1;
/* Truncate the result - this will mangle [0, SIZE_INT_MAX]
number of elements as zero. */
- dmax = dmax.zext (TYPE_PRECISION (TREE_TYPE (max)));
- gcc_assert (dmax.fits_uhwi ());
- write_unsigned_number (dmax.low);
+ wmax = wi::zext (wmax, TYPE_PRECISION (TREE_TYPE (max)));
+ gcc_assert (wi::fits_uhwi_p (wmax));
+ write_unsigned_number (wmax.to_uhwi ());
}
else
{