From patchwork Wed Jul 27 03:44:37 2022 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: 197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp154645pxt; Tue, 26 Jul 2022 20:45:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sDbC2xKQjIPxfuWerfvd57hpqjM0ZBfKnN3k/zEW3XN4zNkxqaHarU9jGD51IdiCOdvNBt X-Received: by 2002:a05:6402:1102:b0:43a:9cf7:68a3 with SMTP id u2-20020a056402110200b0043a9cf768a3mr21264462edv.68.1658893556228; Tue, 26 Jul 2022 20:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658893556; cv=none; d=google.com; s=arc-20160816; b=j22iiZtwcRdTSRVKiheY5uumMBoCgay0iBZz6aLY8WmAuWKJkrqigONf6cJR8WnGg4 KdZfcLwuoLNxh/pRzYBRYcrI5kJCxXxcivrIC3tUWp5ExJjdtLfrusl7OnU9PBKu/3D8 T8jMOP6TavwAw7w43dAuj0ZrqfHAxnWkuPS2Wkal461KzV3K9ZBo3WAyPlEcotYQDuGP zcJyDjszHVHsqNMfyr30jDrosxRUdCO/McFVpDlC9EnQZ36VGxiDzq4TNj+cZLtlkqVb pj4sYQRcvNGNFIIK7d4Nufb4lm4T4M31WAt9hQuwXVklPlAR6NknfVok/wvFeibYewmU Vmsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dmarc-filter:delivered-to; bh=isT0ivaH3kHqReY3bUBzAnjBsiYhR249+54/Ysmb7/Y=; b=b64PdPTSSovfb6gciAqKgoQFquRsz+bfdpOAFzSy+9QujMdm5e9kzUu8XmitJcXkl5 XvCLEoq251SQhRYLzp3Na8uNHaaqo960ay34zm4AmnY08CrV2bJbM1ynMzKxzFn0MtQJ 3bgw5aY85Yun6w0+cEKNLPsRYHE4p0dBwwGJ70ezDF71qfvhyoRh4rtU3PgklRpoLw+g ef8eZLB3/V0XfZOj8kCiPR6dZnJltZr9MbYrDtYyjN+aO1hH0HmFHoqUDHqEQ8WQI3aL 4Kq+OtFDvGxUt6028baiwUu3pUxWJ4UFV/FprN6jq49nlDFm2tWxYLYG02b+cSw5Yf7s Ye6g== ARC-Authentication-Results: i=1; mx.google.com; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cw15-20020a170906478f00b0072b749835e9si5645414ejc.850.2022.07.26.20.45.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 20:45:56 -0700 (PDT) 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; 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 838CF385AE45 for ; Wed, 27 Jul 2022 03:45:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by sourceware.org (Postfix) with ESMTPS id D992D3857C52 for ; Wed, 27 Jul 2022 03:45:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D992D3857C52 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: bizesmtp82t1658893489tp2nk9yr Received: from server1.localdomain ( [42.247.22.66]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 27 Jul 2022 11:44:48 +0800 (CST) X-QQ-SSF: 01400000000000C0H000000A0000000 X-QQ-FEAT: nMuci6qhceP+zavxxo4VgM/xD97PW+7y4occEKBzZVTQBVXXUOsMwOlPEYLJJ J2fVBYAjiYPZbWAbDJgoruPrJ1aPz7PLG3TMxEpR9cmzhC81Yl4lkg0kQRsxeSH/YMppyFX xY0Lsi7L2KiYes/eavjtqt7+WspBTtPoSlPwAl5Tp95U6r46hfBqx2NdoGwjyxoauQQ8zC4 a+qAs872DvKfCYBSOJrRFjuejaU69UTUH/VC5NiGBIRTxyHpQb3t4YnfC7uYAwjGr3l0lNK 3NQnkuhpgvGVixbzLl6chnDQYGf206igYklONz7+v+5Wn2nwzl8o84J2GqkSisAkvJ9ru1q TbJnanUwZL+IByE7ZpwABzTQx63yf3IGaEGDD0LC0+6EEtWTu1UbCzE6ASp4sKM3MNcM8xb X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/1] Fix bit-position comparison Date: Wed, 27 Jul 2022 11:44:37 +0800 Message-Id: <20220727034437.154625-2-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220727034437.154625-1-juzhe.zhong@rivai.ai> References: <20220727034437.154625-1-juzhe.zhong@rivai.ai> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybgforeign:qybgforeign3 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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: , Cc: jakub@redhat.com, richard.earnshaw@arm.com, rguenther@suse.de, richard.sandiford@arm.com, gnu@the-meissners.org, jlaw@tachyum.com, zhongjuzhe , davem@redhat.com, kenner@nyu.edu, ian@airs.com, wilson@tuliptree.org, joseph@codesourcery.com 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?1739475969830841128?= X-GMAIL-MSGID: =?utf-8?q?1739475969830841128?= From: zhongjuzhe gcc/ChangeLog: * expr.cc (expand_assignment): Change GET_MODE_PRECISION to GET_MODE_BITSIZE --- gcc/expr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/expr.cc b/gcc/expr.cc index 80bb1b8a4c5..ac2b3c07df6 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -5574,7 +5574,7 @@ expand_assignment (tree to, tree from, bool nontemporal) code contains an out-of-bounds access to a small array. */ if (!MEM_P (to_rtx) && GET_MODE (to_rtx) != BLKmode - && known_ge (bitpos, GET_MODE_PRECISION (GET_MODE (to_rtx)))) + && known_ge (bitpos, GET_MODE_BITSIZE (GET_MODE (to_rtx)))) { expand_normal (from); result = NULL;