aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc9
-rw-r--r--gcc/rust/rust-gcc.cc2
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index b369372..8b56be7 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -2135,7 +2135,14 @@ CompileExpr::compile_integer_literal (const HIR::LiteralExpr &expr,
tyty->get_name ().c_str ());
return error_mark_node;
}
- return double_int_to_tree (type, mpz_get_double_int (type, ival, true));
+
+ tree result = wide_int_to_tree (type, wi::from_mpz (type, ival, true));
+
+ mpz_clear (type_min);
+ mpz_clear (type_max);
+ mpz_clear (ival);
+
+ return result;
}
tree
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index 5bb5313..7fd9b65 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -1028,7 +1028,7 @@ Gcc_backend::integer_constant_expression (tree t, mpz_t val)
if (t == error_mark_node)
return error_mark_node;
- tree ret = double_int_to_tree (t, mpz_get_double_int (t, val, true));
+ tree ret = wide_int_to_tree (t, wi::from_mpz (t, val, true));
return ret;
}