public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/rust/master] backend: Don't fold convert_to expressions
Date: Fri,  9 Dec 2022 09:29:46 +0000 (GMT)	[thread overview]
Message-ID: <20221209092946.4AC0C395B072@sourceware.org> (raw)

https://gcc.gnu.org/g:a6285cf21959e806066edd8984caddc23fea2fce

commit a6285cf21959e806066edd8984caddc23fea2fce
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date:   Thu Nov 17 13:41:31 2022 +0100

    backend: Don't fold convert_to expressions

Diff:
---
 gcc/rust/backend/rust-compile-expr.cc | 8 ++++----
 gcc/rust/rust-gcc.cc                  | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index e50df63821f..8df34c24497 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -2278,13 +2278,13 @@ CompileExpr::type_cast_expression (tree type_to_cast_to, tree expr_tree,
     }
   else if (TREE_CODE (type_to_cast_to) == INTEGER_TYPE)
     {
-      tree cast = fold (convert_to_integer (type_to_cast_to, expr_tree));
+      tree cast = convert_to_integer (type_to_cast_to, expr_tree);
       // FIXME check for TREE_OVERFLOW?
       return cast;
     }
   else if (TREE_CODE (type_to_cast_to) == REAL_TYPE)
     {
-      tree cast = fold (convert_to_real (type_to_cast_to, expr_tree));
+      tree cast = convert_to_real (type_to_cast_to, expr_tree);
       // FIXME
       // We might need to check that the tree is MAX val and thusly saturate it
       // to inf. we can get the bounds and check the value if its >= or <= to
@@ -2295,12 +2295,12 @@ CompileExpr::type_cast_expression (tree type_to_cast_to, tree expr_tree,
     }
   else if (TREE_CODE (type_to_cast_to) == COMPLEX_TYPE)
     {
-      return fold (convert_to_complex (type_to_cast_to, expr_tree));
+      return convert_to_complex (type_to_cast_to, expr_tree);
     }
   else if (TREE_CODE (type_to_cast_to) == POINTER_TYPE
 	   && TREE_CODE (TREE_TYPE (expr_tree)) == INTEGER_TYPE)
     {
-      return fold (convert_to_pointer (type_to_cast_to, expr_tree));
+      return convert_to_pointer (type_to_cast_to, expr_tree);
     }
   else if (TREE_CODE (type_to_cast_to) == RECORD_TYPE
 	   || TREE_CODE (type_to_cast_to) == ARRAY_TYPE)
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index e5dc6dacc76..5bb5313b1dc 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -1171,14 +1171,14 @@ Gcc_backend::convert_expression (tree type_tree, tree expr_tree,
       ret = expr_tree;
     }
   else if (TREE_CODE (type_tree) == INTEGER_TYPE)
-    ret = fold (convert_to_integer (type_tree, expr_tree));
+    ret = convert_to_integer (type_tree, expr_tree);
   else if (TREE_CODE (type_tree) == REAL_TYPE)
-    ret = fold (convert_to_real (type_tree, expr_tree));
+    ret = convert_to_real (type_tree, expr_tree);
   else if (TREE_CODE (type_tree) == COMPLEX_TYPE)
-    ret = fold (convert_to_complex (type_tree, expr_tree));
+    ret = convert_to_complex (type_tree, expr_tree);
   else if (TREE_CODE (type_tree) == POINTER_TYPE
 	   && TREE_CODE (TREE_TYPE (expr_tree)) == INTEGER_TYPE)
-    ret = fold (convert_to_pointer (type_tree, expr_tree));
+    ret = convert_to_pointer (type_tree, expr_tree);
   else if (TREE_CODE (type_tree) == RECORD_TYPE
 	   || TREE_CODE (type_tree) == ARRAY_TYPE)
     ret = fold_build1_loc (location.gcc_location (), VIEW_CONVERT_EXPR,

                 reply	other threads:[~2022-12-09  9:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221209092946.4AC0C395B072@sourceware.org \
    --to=tschwinge@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).