From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id BD18938560A4; Mon, 29 Aug 2022 15:35:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD18938560A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661787351; bh=6KJgrjeI6dDGGR+dULjsiVZ4Rd2YSnMg2cDa/agOTAM=; h=From:To:Subject:Date:From; b=Ou4ZS19TMsLZ4Tr9nqQqAdIbnjtZJki8WqmJmkv735KwtrnYqOz95m8000Sm4f+oq rUeIyfPKNXVGWuNfwQ3A/MWRlDMRSWvopqr7Zz/7l7iG63kz6TLi7dLNXluWK+UX9c qy8x+dQd2IPA2CVwf1/ERJQqcFauZy8QJN/mfSOQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Fix port of NOP_EXPR X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 5a8f2fd653afe2e60672678d9cbfe0fa8a5e4124 X-Git-Newrev: a3e1361d1ac1ae892d25737e0ee21e71db423a07 Message-Id: <20220829153551.BD18938560A4@sourceware.org> Date: Mon, 29 Aug 2022 15:35:51 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a3e1361d1ac1ae892d25737e0ee21e71db423a07 commit a3e1361d1ac1ae892d25737e0ee21e71db423a07 Author: Philip Herron 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, "% 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);