]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/typeck2.c
Merge with trunk.
[thirdparty/gcc.git] / gcc / cp / typeck2.c
index 9fa201dca2c3b57e9d37ab79aa6254bcf3f4713f..333343b8969cb57aa48278f4c1eb847250ad9a6a 100644 (file)
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cp-tree.h"
 #include "flags.h"
 #include "diagnostic-core.h"
+#include "wide-int.h"
 
 static tree
 process_init_constructor (tree type, tree init, tsubst_flags_t complain);
@@ -1122,12 +1123,10 @@ process_init_constructor_array (tree type, tree init,
     {
       tree domain = TYPE_DOMAIN (type);
       if (domain && TREE_CONSTANT (TYPE_MAX_VALUE (domain)))
-       len = (tree_to_double_int (TYPE_MAX_VALUE (domain))
-              - tree_to_double_int (TYPE_MIN_VALUE (domain))
-              + double_int_one)
-             .ext (TYPE_PRECISION (TREE_TYPE (domain)),
-                   TYPE_UNSIGNED (TREE_TYPE (domain)))
-             .low;
+       len = wi::ext (wi::to_offset (TYPE_MAX_VALUE (domain))
+                      - wi::to_offset (TYPE_MIN_VALUE (domain)) + 1,
+                      TYPE_PRECISION (TREE_TYPE (domain)),
+                      TYPE_SIGN (TREE_TYPE (domain))).to_uhwi ();
       else
        unbounded = true;  /* Take as many as there are.  */
     }