From patchwork Mon Sep 16 08:10:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianmiao Qu X-Patchwork-Id: 1985994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=BAzj+BKO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X6d0v1rd5z1y1m for ; Mon, 16 Sep 2024 18:11:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D86B9385843B for ; Mon, 16 Sep 2024 08:11:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by sourceware.org (Postfix) with ESMTPS id E6EBE3858D20 for ; Mon, 16 Sep 2024 08:11:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6EBE3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.alibaba.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E6EBE3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=115.124.30.118 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726474280; cv=none; b=ZyfWoRrb4pqh0pKnPnMD2Re7ahMOUeLAmFMVJCKLpITN5hh0bzv1GDXC3Sz6Dlnp6aq6ax+JHMExScK7c/07H8Bv1nF0OPp3VMKNdsX4RKJLVh6PDbROL7r1EHW7DNzjO6EiMAc6/gcIQNKcqAflRoM6UNYP1g5RgMhuejVTvT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726474280; c=relaxed/simple; bh=J5Wa+ecQDhmtiydvt+vrqzSVzCZNyzlXLhCgDmCFer0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=sutyWg1d8Z5apa7ccepLXNnl/wkaupJ1WIGG+8LlZ/rn/jwvzM4yIitI/YgPC/aj+7XYtOnniDyH1qt8Lga3THj6hdD0nM2VUvsRUKSewpI6NCsfX0EBpn4TJB6RwgLO0n9TN6r+PvkrUrrYCW+1bZkpZx99+yEBtWLo+b9gdcc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1726474276; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=ZcEYXgGigosdpq/YQW0fsu+ZnFY1V7xNzT9Pape+8aY=; b=BAzj+BKOyXqOj7Fckzf3fli3kBlpLb0MhLAVdnUgnLYDpIr4+odZuuotGhhmQ9Xkn/NsrVsWe0gLjdLLPy09gcwOJQSKQ0G+7EdVzMPy4Vy8HH7EdzvCs/uGpGtheBT4tiJ16TrkuGOjAPz0X2Qo9PBQfts5WSKvh/WyOzRaHXo= Received: from localhost(mailfrom:cooper.qu@linux.alibaba.com fp:SMTPD_---0WF20t21_1726474271) by smtp.aliyun-inc.com; Mon, 16 Sep 2024 16:11:11 +0800 From: Xianmiao Qu To: gcc-patches@gcc.gnu.org, jeffreyalaw@gmail.com, kito.cheng@gmail.com Cc: Xianmiao Qu Subject: [PATCH 1/2] RISC-V: Fix the outer_code when calculating the cost of SET expression. Date: Mon, 16 Sep 2024 16:10:56 +0800 Message-Id: <20240916081056.29251-1-cooper.qu@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org I think it is a typo. When calculating the 'SET_SRC (x)' cost, outer_code should be set to SET. gcc/ * config/riscv/riscv.cc (riscv_rtx_costs): Fix the outer_code when calculating the cost of SET expression. --- gcc/config/riscv/riscv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 6efe14ff199f..1b4a5c39c667 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -3775,7 +3775,7 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN *total = COSTS_N_INSNS (1); return true; } - riscv_rtx_costs (SET_SRC (x), mode, outer_code, opno, total, speed); + riscv_rtx_costs (SET_SRC (x), mode, SET, opno, total, speed); return true; }