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: =?utf-8?b?6ZKf5bGF5ZOy?= X-Patchwork-Id: 1661075 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lt06W3ztfz9s1l for ; Wed, 27 Jul 2022 13:45:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 243E5385701A for ; Wed, 27 Jul 2022 03:45:17 +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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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;