aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 8df34c2..b369372 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -2220,9 +2220,7 @@ CompileExpr::compile_string_literal (const HIR::LiteralExpr &expr,
rust_assert (ok);
tree type = TyTyResolveCompile::compile (ctx, usize);
- mpz_t ival;
- mpz_init_set_ui (ival, literal_value.as_string ().size ());
- tree size = double_int_to_tree (type, mpz_get_double_int (type, ival, true));
+ tree size = build_int_cstu (type, literal_value.as_string ().size ());
return ctx->get_backend ()->constructor_expression (fat_pointer, false,
{data, size}, -1,
@@ -2618,7 +2616,7 @@ HIRCompileBase::resolve_unsized_slice_adjustment (
TYPE_PRECISION (TREE_TYPE (domain)),
TYPE_SIGN (TREE_TYPE (domain)))
.to_uhwi ();
- tree size = build_int_cst (size_type_node, array_size);
+ tree size = build_int_cstu (size_type_node, array_size);
return ctx->get_backend ()->constructor_expression (fat_pointer, false,
{data, size}, -1, locus);