From patchwork Wed Jul 27 03:44:36 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: 7 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp154623pxt; Tue, 26 Jul 2022 20:45:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vF6mXnyrKRG1BHQdhkJJgvHa3hiCl9VjaN9r2DM548vkyHVXOZpNNa6bDVaaE4qQvkJnJ4 X-Received: by 2002:a05:6402:5516:b0:43a:42f9:24d6 with SMTP id fi22-20020a056402551600b0043a42f924d6mr9364438edb.204.1658893551873; Tue, 26 Jul 2022 20:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658893551; cv=none; d=google.com; s=arc-20160816; b=0UOlN1Mt1CmF6JmQBd8gfyKPO5xaUW3NdjDAVbKxp6LK64F11YUy/MUimWTH7jLAaY KmUv+r+Pn7tWcimwGpD/d+Q5/6ovRXS/0q4iBIO1uJt3dioTpo/yaNyVNdHx4vyCwWVE FlUje+k7ijampZ8mo4j1kSB4PTHzqPOXQHAORN7U9av7Wo+MzvkcpHkguuTjU5zE7Rhj 3rbAxnQ8tNW5/4d8WLKYw5okN6egNU/2cE/zUM8GImNE+phGRUFk71SJfxZSmPdR1FzO hNwt9JY6LdZ5/+oMvmrV5yQQsUZbpgTDHrgKL9Gb6V8Wy1s2BFb+W7ArMbvqN6T0DMuD 5nqQ== 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:message-id:date:subject:to :from:dmarc-filter:delivered-to; bh=3Q4mc3zUUkczD5TXBF+m+94I+j5zTH8T85avNlDZ7AQ=; b=w4SewuANShPvC96tND2Iv7F67x0dHRJfxE6nxabM/Q4Mi5VpucQ76zvZ0q1wX+npXX GQcP/0mvwU0lLTZw+oCF9bup8lkdPDIK0o1iERdPqsemMeH4ie93S/d1mbqSCE7MIggX DJQRjUiUBASwHqjFQXriVSWwKSX+Pr5Cprco31BK7tR1jsfrkgy5N2qbhtV/P59Wkmlv KmHM5+ZL0u9VljAiGe5B5uZtP++1aFVGQ6FN+ZidZQL0Z0wsuD9MQNQKbb7sBwjADGum zJYTONw2lhHUjNP8aSvdZ4dejh+zZ4Ai973Hed8l6BLWxf36/zZ1tOcTwPUmAJs0lPuH pWYg== 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 x23-20020aa7d397000000b0043a7983aeffsi15439413edq.61.2022.07.26.20.45.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 20:45:51 -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 EF0983856DDD for ; Wed, 27 Jul 2022 03:45:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by sourceware.org (Postfix) with ESMTPS id 30C233857C56 for ; Wed, 27 Jul 2022 03:44:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30C233857C56 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: bizesmtp82t1658893483tp0s8m5m Received: from server1.localdomain ( [42.247.22.66]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 27 Jul 2022 11:44:41 +0800 (CST) X-QQ-SSF: 01400000000000C0H000000A0000000 X-QQ-FEAT: HH6/KuQOBEaCnMs5Rmj0ZHw2srIJUuj4Nj4/0HfqRLgMfNXyMG3LeNz1oS+Oc 8mKGCq1M3l3VX+p7WoxaKa96gIYuB9j1OoY8UqaqtQ0dwq3ewIIjENndUYoL7wTYO0PPOmA UV0CvgsG4NSRIPNZQ5/IFtkuWk5XkyRdqtZNn36hNvz95jlkGo3ov9B1pI8/+F1I9BkP20t JZ8iSqURcBuwOp/TmxtfBJCKVgeV7bm864vnbuwzoib3CKfvYzzdBXp6xoX+srkGcVCsHuS VunQLgLAwlivV9vP8HM7n4K8z9ijZEX7l+F10nDBZcFTHSYmPdJP5O3pSDh5ahwEQPg3WMY c4hag1/9cyTXl1SR8hjMiBqL87NmtO6g5T0efgaJOfLsKb/svoJ8P/s3FrTQv9oTdknL0WG X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/1] middle-end: Fix bit position comparison Date: Wed, 27 Jul 2022 11:44:36 +0800 Message-Id: <20220727034437.154625-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybgforeign:qybgforeign10 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_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?1739475964813658765?= X-GMAIL-MSGID: =?utf-8?q?1739475964813658765?= From: zhongjuzhe Hi, variable "bitpos" is compute using bitsize. I think it makes sense for bit position checking whether it is out-of-bounds to array using GET_MODE_BITSIZE instead of GET_MODE_PRECISION. This patch is useful for RVV (RISC-V 'V') support that I am going to push upstream. Thanks! *** BLURB HERE *** zhongjuzhe (1): Fix bit-position comparison gcc/expr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)