Message ID | 20230221120230.596966-103-arthur.cohen@embecosm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1848730wrn; Tue, 21 Feb 2023 05:03:00 -0800 (PST) X-Google-Smtp-Source: AK7set+MQwYNVboA+pqlX227ysMuDELOuMEFKEJTS2diBa2FviOHzeOxhkFktciilMqQC4KN1J5r X-Received: by 2002:a05:6402:35d0:b0:4ad:f811:e267 with SMTP id z16-20020a05640235d000b004adf811e267mr4523733edc.12.1676984580359; Tue, 21 Feb 2023 05:03:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676984580; cv=none; d=google.com; s=arc-20160816; b=hWLAVsGws0Z2xmr4fqP/10Mdt6RMzocfdfG0x18DFnZhZEzNXEPBLBPknm7BLBPmCP p++XMsKgtFf9vpSJAxGMGB3LeT7hmGum/5WvIQnc8N5ElfNBQ4s84LvsannLcXDY08af wM6sXG7vm/Kf9oL7VvwjJsEqPcWapkEivGVMDXPy2hfCLHeh7iTUa03jlF8yJqJsWF1o mrO0DFa3HoJ7VOunIioYpSqOYTTG7UJ4KZbJqgUAW3XqJY01SXpdSSUw/snM2oW1nXFI poEVSiskl02Cr1mcAaLxmcU5MPZFelvHfcFRmZ1Gf0LKU8MeyUlnrKMhft4V2roeLHZ3 /kPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dmarc-filter :delivered-to; bh=O+eVsLskO//1T8m9ezVwPdHxARyYtOAjaAGX8aDDa28=; b=xBPC2YS0HxtAB56RGrnseyRvYGY88Y+3tpPVhNr6kpscCy89w8aaPVk75fRXzS16Um bG2+ms+sAQGk1hM+WM96cYSbqobqcApm/89HNxOcoDqBq4SX60JZv0ZhxCOB25P/aAM2 RjAn5KJtrvd8bnWJshtTGibNB6imTkvJ6zSlmFVGsFx5EA2UAuKCu0MrzK9egVeOzqQf A0WOXNzYnf8ViV8xSeeTq3/Vx7o7li4GOSfzES6NtJuwdOxEt2lmuFhs/GsK9Y4akHrS Bl8AiZ8QI4ku5zJBBKllbRymwdOQwKZbO0BHCyvxIXZhek/AvRsXFaUnuHYeCDfMkW1A 8wkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=L78VhTBP; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b16-20020aa7dc10000000b004ad0c88b54dsi15639753edu.527.2023.02.21.05.03.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 05:03:00 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=L78VhTBP; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 45E0C383504F for <ouuuleilei@gmail.com>; Tue, 21 Feb 2023 12:22:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 67B213889E2E for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 12:04:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 67B213889E2E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42c.google.com with SMTP id c12so4165781wrw.1 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 04:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=O+eVsLskO//1T8m9ezVwPdHxARyYtOAjaAGX8aDDa28=; b=L78VhTBP6jzDXbqD4gKNh1d+oal3tfy5on7GMPV2MdnNsqgW0UKFoHNbd7P6nej8Q+ wFCGbliI6zWh+3j+b4Qv853FMiGU7duXkgknu2MHxRxiwnf0K1JMEaJPOD72f2CKT1Jz dxhIwSFp+YtftYyRNAGfB8Tavdq6pZ9eLC6aIHy6qNcjrmnWqbcDG0xb0nVcW6s3ivrm M5BrYS+P4SlHqDobTRUWlrOg7K63kgq7aIKxsv8Jae1JBdMR8Ol+ocxRy7aXpid1/8ud 9KOgUdebegESb9Qbrv9Ay+EKirAmwusrp2Y8hqtA18ZFDuPHa8PRHwPD00TGD1hNlG2i h0zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=O+eVsLskO//1T8m9ezVwPdHxARyYtOAjaAGX8aDDa28=; b=CeMtNbBGad66qJ15aC6QxVLpS/M3LNR4gC4l5W8eXuI0YaQnjE9agltwYR6GEzKv7C 2gHi7PkrM/5YW4YEECJY3br3p9Pj1wxh/9l7uLnkZ7KQEtN+eeWztOJXDPNas5yEzBps 99XDHRb0j1/iwfBJXXGbO5DXl0DKZXzdo4U/wLQeCXTb8HHc5RX21CS0kAVUaIjJAUFo gpErWB8hgNH5n+KkLkmaY8AL+ZVNLFDZyj8hDCClXGTia1ZTIlgJjnFCDIcMWrbCpWS6 eSrbsVS7W7k9T6Jpj4WjbwY1xe7ou6w4IDoiNJ6DZn81P63q6WsSEnFiOruW/YWa7Atd eICw== X-Gm-Message-State: AO0yUKWhyONw2AucyXq5GFUYKJL3VKv7cUTCq+USRrsCg5n6i/u8nPnf O3svEqokSCf4Kvz0CduuOuHrfl6saKKMY45N2g== X-Received: by 2002:a5d:5985:0:b0:2c5:7dd2:319f with SMTP id n5-20020a5d5985000000b002c57dd2319fmr3893874wri.32.1676981083747; Tue, 21 Feb 2023 04:04:43 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c15-20020adffb4f000000b002c55b0e6ef1sm5013811wrs.4.2023.02.21.04.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:04:43 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen <arthur.cohen@embecosm.com> Subject: [committed 102/103] gccrs: const evaluator: Remove get_nth_callarg Date: Tue, 21 Feb 2023 13:02:32 +0100 Message-Id: <20230221120230.596966-103-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com> References: <20230221120230.596966-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758445783342823877?= X-GMAIL-MSGID: =?utf-8?q?1758445783342823877?= |
Series |
[committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Feb. 21, 2023, 12:02 p.m. UTC
From: Arthur Cohen <arthur.cohen@embecosm.com>
We only used one path of the C++ folder's get_nth_callarg function:
CALL_EXPR_ARG. Replace all calls to get_nth_callarg by macro calls to
CALL_EXPR_ARG
gcc/rust/ChangeLog:
* backend/rust-constexpr.cc (get_nth_callarg): Remove function.
(rs_bind_parameters_in_call): Use CALL_EXPR_ARG instead.
(potential_constant_expression_1): Likewise.
---
gcc/rust/backend/rust-constexpr.cc | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc index 912d73b5d7c..4e581a3f2cf 100644 --- a/gcc/rust/backend/rust-constexpr.cc +++ b/gcc/rust/backend/rust-constexpr.cc @@ -81,8 +81,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, bool potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, tsubst_flags_t flags); -inline tree -get_nth_callarg (tree t, int n); tree unshare_constructor (tree t MEM_STAT_DECL); void @@ -3081,7 +3079,7 @@ rs_bind_parameters_in_call (const constexpr_ctx *ctx, tree t, tree fun, tree type = parms ? TREE_TYPE (parms) : void_type_node; if (parms && DECL_BY_REFERENCE (parms)) type = TREE_TYPE (type); - x = get_nth_callarg (t, i); + x = CALL_EXPR_ARG (t, i); if (TREE_ADDRESSABLE (type)) /* Undo convert_for_arg_passing work here. */ @@ -4080,17 +4078,6 @@ maybe_constexpr_fn (tree t) return (DECL_DECLARED_CONSTEXPR_P (t)); } -// forked from gcc/cp/constexpr.cc get_nth_callarg - -/* We have an expression tree T that represents a call, either CALL_EXPR. - Return the Nth argument. */ - -inline tree -get_nth_callarg (tree t, int n) -{ - return CALL_EXPR_ARG (t, n); -} - // forked from gcc/cp/constexpr.cc var_in_maybe_constexpr_fn /* True if T was declared in a function that might be constexpr: either a @@ -5808,7 +5795,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun) && !DECL_CONSTRUCTOR_P (fun)) { - tree x = get_nth_callarg (t, 0); + tree x = CALL_EXPR_ARG (t, 0); /* Don't require an immediately constant value, as constexpr substitution might not use the value. */ @@ -5837,7 +5824,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, } for (; i < nargs; ++i) { - tree x = get_nth_callarg (t, i); + tree x = CALL_EXPR_ARG (t, i); /* In a template, reference arguments haven't been converted to REFERENCE_TYPE and we might not even know if the parameter is a reference, so accept lvalue constants too. */