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] Fix port of NOP_EXPR
Date: Mon, 29 Aug 2022 15:35:51 +0000 (GMT)	[thread overview]
Message-ID: <20220829153551.BD18938560A4@sourceware.org> (raw)

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

commit a3e1361d1ac1ae892d25737e0ee21e71db423a07
Author: Philip Herron <philip.herron@embecosm.com>
Date:   Tue Aug 23 17:42:17 2022 +0100

    Fix port of NOP_EXPR
    
    NOP_EXPR should fall through into convert and view_convert_exprs.

Diff:
---
 gcc/rust/backend/rust-constexpr.cc | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc
index 36da7cb26ab..8c0f80b9e33 100644
--- a/gcc/rust/backend/rust-constexpr.cc
+++ b/gcc/rust/backend/rust-constexpr.cc
@@ -2080,15 +2080,6 @@ eval_constant_expression (const constexpr_ctx *ctx, tree t, bool lval,
 				    non_constant_p, overflow_p);
       break;
 
-    case NOP_EXPR:
-      if (REINTERPRET_CAST_P (t))
-	{
-	  if (!ctx->quiet)
-	    error_at (loc, "%<reinterpret_cast%> is not a constant expression");
-	  *non_constant_p = true;
-	  return t;
-	}
-      /* FALLTHROUGH.  */
     case MODIFY_EXPR:
       r = eval_store_expression (ctx, t, false, non_constant_p, overflow_p);
       break;
@@ -2347,6 +2338,7 @@ eval_constant_expression (const constexpr_ctx *ctx, tree t, bool lval,
       break;
 
       /* FALLTHROUGH.  */
+    case NOP_EXPR:
     case CONVERT_EXPR:
       case VIEW_CONVERT_EXPR: {
 	tree oldop = TREE_OPERAND (t, 0);

                 reply	other threads:[~2022-08-29 15:35 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=20220829153551.BD18938560A4@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).