public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] backend: Replace double_int_to_tree -> wide_int_to_tree
@ 2022-12-09 9:29 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-12-09 9:29 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:277497f77cdbd85e4aad4a52bce3ea442a44cdc0
commit 277497f77cdbd85e4aad4a52bce3ea442a44cdc0
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Thu Nov 17 15:59:34 2022 +0100
backend: Replace double_int_to_tree -> wide_int_to_tree
Diff:
---
gcc/rust/backend/rust-compile-expr.cc | 9 ++++++++-
gcc/rust/rust-gcc.cc | 2 +-
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 e50df63821f..22f24dbf038 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 e5dc6dacc76..319c581909b 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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-09 9:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 9:29 [gcc/devel/rust/master] backend: Replace double_int_to_tree -> wide_int_to_tree Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).