From patchwork Mon Mar 13 14:17:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 68861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1213963wrd; Mon, 13 Mar 2023 07:18:58 -0700 (PDT) X-Google-Smtp-Source: AK7set+iYtt/DKDPlGd/vO5/q2GgxudgTuDcn4Np9vd35eroHUT57KfKpPH9ZCFj0OFUY3/C0o18 X-Received: by 2002:a17:906:fe08:b0:881:23a:aba5 with SMTP id wy8-20020a170906fe0800b00881023aaba5mr46025882ejb.11.1678717138526; Mon, 13 Mar 2023 07:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678717138; cv=none; d=google.com; s=arc-20160816; b=YWCPUwD6ZBKNgl1zqn71T1zTJDxIpHAgdWpldwZrYq88MhjMjqlhsTZvPVrj6UMrNX uZBTItVFqPkqzjnhzS2IRNPyWeJn0IO/39QOMdIz9cIwHgnMljweCmTXBGWcT/fYIJRp lzZYXsg4Mkco+OZQAr97fmliZKSI9KRPipejXX2teVj5SxFhiD3EwvR/rQHCK5qlM8Nu 1So8whVZAhlF28nxvBIeLOklbBSFfJDecI7d0QMxE57iRWZnfDG/koXScUFN3LVNa9qn yd5N+8Bh4nj+TB/oisE8f7IY/zNNfzzy2aH+FZGQsRdnTojgRDXaftpdKUii2W3Y0xiu P5BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=Z8P+gCMUqcbDIqd7IGaXAeDYKOnlPpqcDPWHn5tIiLg=; b=aHVp+m64LEfkSf8w3Hu5pbvXB7YILsWVv2RVIJFu4OiqKATa7M7zdrTjISqxhqOnyX 1Uo5dhlNLhk8EsKcGzHK0HlxbelaNbBZTo9poFgLSwBPnfb33YwZ2F5ml2bn6QMq7jP6 JnrOglbhq9fXPY/8b2ieuLVWY7jv+6gBtx2Ml5lSvqxs1+PJ9boagIH4kYKgedE7hxAY jDiBuHUCoweLA0aioTTJ4MoU1d5nvuG9mZ1r1d4fCekfqtEwkYvICKmE6utfwa7uDDoM sSET5DvVTxAYw8bkV6dLgzBrdLPiVJWVQAda5WvRQ4Pfup/3dwBc7AYatud4Cfe9DPpU RnoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id he19-20020a1709073d9300b0091f730541efsi1121315ejc.302.2023.03.13.07.18.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 07:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 C0ABE3858409 for ; Mon, 13 Mar 2023 14:18:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbg154.qq.com (smtpbg154.qq.com [15.184.224.54]) by sourceware.org (Postfix) with ESMTPS id D9FF53858D1E for ; Mon, 13 Mar 2023 14:18:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D9FF53858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp91t1678717080t7l1ihv0 Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 13 Mar 2023 22:17:59 +0800 (CST) X-QQ-SSF: 01400000000000E0N000000A0000000 X-QQ-FEAT: +ujAKkuGAaXT7U+Gt9oyeCp8vN4hLHFvDEG/CQc+edKLTXqvP85oGIKZjUAV5 yGU0A7UNMM2Cvo61y/ysNFfgi9vngmAsTTPvt1MotZiTbJmCBZczb0MBPcja59ObvkAK8LS a3qQCb4nz4u97DouoAzuirDXgkHgAeCW2zkir0M/0xJXJa7dZETtJ+UuQj9GiAt/pKiOPl3 ChvwF5sZ+5/iuYWzcVSzJd8xlQ7U49OQnTu91PiE4cnkM1QqaEZMkV2QJRKORKG2R/bne5r JNHuRvMT39YxtglL58avzKhAFH3vyVMvNnISbmcoErMgt551MbjXBYmS/c3ki4TG75qv0Tl YuTh2wrTIaLZGuUgHslegiP5uVKViAEugGv6ZY50NU80DdkM3uI20m6UZwimkP+S64Fuu61 X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, Ju-Zhe Zhong Subject: [PATCH] RISC-V: Fix Bug 109092 Date: Mon, 13 Mar 2023 22:17:57 +0800 Message-Id: <20230313141757.277008-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760262502151886331?= X-GMAIL-MSGID: =?utf-8?q?1760262502151886331?= From: Ju-Zhe Zhong This patch fix bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109092. gcc/ChangeLog: * config/riscv/riscv.md: Fix subreg bug. --- gcc/config/riscv/riscv.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 371d6838c0b..700f3c28bc3 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -1364,8 +1364,8 @@ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" " r,m")))] "TARGET_64BIT && !TARGET_ZBA - && !(REG_P (operands[1]) - && REGNO (operands[1]) == VL_REGNUM)" + && !(register_operand (operands[1], SImode) + && reg_or_subregno (operands[1]) == VL_REGNUM)" "@ # lwu\t%0,%1" @@ -1747,7 +1747,7 @@ "(register_operand (operands[0], SImode) || reg_or_0_operand (operands[1], SImode)) && !(register_operand (operands[1], SImode) - && REGNO (operands[1]) == VL_REGNUM)" + && reg_or_subregno (operands[1]) == VL_REGNUM)" { return riscv_output_move (operands[0], operands[1]); } [(set_attr "move_type" "move,const,load,store,mtc,fpload,mfc,fpstore,rdvlenb") (set_attr "mode" "SI")