]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/mangle.c
Merge from trunk.
[thirdparty/gcc.git] / gcc / cp / mangle.c
index 8a24d6c8cfd93defe7ea8e3a58c087be7f0c075f..5b7120b4bcf9f21e15dffd35d89ea8880d325bcd 100644 (file)
@@ -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.  */
 
@@ -1505,7 +1506,7 @@ write_integer_cst (const tree cst)
 {
   int sign = tree_int_cst_sgn (cst);
 
-  if (TREE_INT_CST_HIGH (cst) + (sign < 0))
+  if (!cst_fits_shwi_p (cst))
     {
       /* A bignum. We do this in chunks, each of which fits in a
         HOST_WIDE_INT.  */
@@ -1531,8 +1532,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)
        {
@@ -3225,12 +3225,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
        {