Message ID | 20230521040459.1964837-1-apinski@marvell.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp703251vqo; Sat, 20 May 2023 21:57:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Z8lt6n/lUgPT10KAZPTxznlDkHL4gTJwAHSeo6NQWNXAXAy50Ta1OYuUn0RCiXps3AJA3 X-Received: by 2002:a17:907:3206:b0:94e:8559:b5c5 with SMTP id xg6-20020a170907320600b0094e8559b5c5mr5207998ejb.64.1684645071150; Sat, 20 May 2023 21:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684645071; cv=none; d=google.com; s=arc-20160816; b=bo4so2jD9JIWUPFttFZD7REaSGwldDOrafVqAZ+2vBoS31PsHYEJwm8FWRWfjOh/1c ooDEh4SAsc1V5QSx0NnWVmKdkWdXWael1mcSY7xFuZxypgrxkC90r1yZfK4eW7FX94gF CaKJySKJ9GaNl9VgtMdcXZ8pFQYcDyZO98GVkzhNjRxEO7ILQ17PJOppIZdbis0vOUp4 znO6Okp3ZFi/dDXGu1MdN+OCFlcbHJb+hlBZdLVo21hAJCi1zHgzV4t4HCGbenEEKV2Q KQjRh3Wb2rj4pItrqLWwQ8AqDspXS1QVyYZYCtwqRc/6ThXzcQ9fWudqVRs0xio2c6sf LXKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=7f8za670kOMKqbWhuVCwTn5pJ7one+LDABq/doAxLeg=; b=A5p/2YtwnzrkEMRq8vvSVSwwwtf6pYNJKGnHSkV8GUMvaHrWfsQweL8gZ5+F/QVRJh zTYvjP2nsZvedQaaVmvaaO3VTcdzQ6aJX7hLMvcd4Yg+sYrC4X57a3h1bF5TDQv/7bTC 3O9ESWniMgv2iDTRtPTfpLGLKeh+sOKdx/2E7KA+xH8tg1kzWdFsBLe4cxQJx/h82TNl D7OmYcVL7rX1YIX21hErSC+BwoPaLgdg+M5dblcqQC0hJx1u10HX5wwDdkQiZC15Kyym bl7iy3oS+B3wZnhBgi0Ti7tjt5AiVlIvc6OfpcF8GYfXRraIr/prOm6z6ZEMg1EoMvGX XnMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kWPg0ZQS; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x25-20020a170906805900b0096f4248a649si1954846ejw.709.2023.05.20.21.57.50 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 21:57: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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kWPg0ZQS; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C56923858C41 for <ouuuleilei@gmail.com>; Sun, 21 May 2023 04:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C56923858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684645069; bh=7f8za670kOMKqbWhuVCwTn5pJ7one+LDABq/doAxLeg=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=kWPg0ZQSqgeX0YuqyotgKT2/guMgWfGjdotfobgGelnnNkgia+x0mTMICGzqGcxgP diKia7K+mVV98nZFDWbnVQS9xSs0j9LzRZ6eB2ODrI6ZdMreMkT7dfK7IJ8mPM22ww XxV231mFl/j2t5pABj+2aHDBrpfqR9i89/xpibsk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by sourceware.org (Postfix) with ESMTPS id 7DCC63858D20 for <gcc-patches@gcc.gnu.org>; Sun, 21 May 2023 04:57:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DCC63858D20 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34L44Aqg027386 for <gcc-patches@gcc.gnu.org>; Sat, 20 May 2023 21:57:06 -0700 Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qpwqjsfu0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Sat, 20 May 2023 21:57:05 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 20 May 2023 21:57:03 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sat, 20 May 2023 21:57:03 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id 283B95B725C; Sat, 20 May 2023 21:05:07 -0700 (PDT) To: <gcc-patches@gcc.gnu.org> CC: Andrew Pinski <apinski@marvell.com> Subject: [PATCH] Fix expand_single_bit_test for big-endian Date: Sat, 20 May 2023 21:04:59 -0700 Message-ID: <20230521040459.1964837-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: UX11KsQ5rQO8JHxBQzII2OATAAz0TCLK X-Proofpoint-GUID: UX11KsQ5rQO8JHxBQzII2OATAAz0TCLK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-21_02,2023-05-17_02,2023-02-09_01 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Andrew Pinski <apinski@marvell.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766477960908106030?= X-GMAIL-MSGID: =?utf-8?q?1766478389833852547?= |
Series |
Fix expand_single_bit_test for big-endian
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Andrew Pinski
May 21, 2023, 4:04 a.m. UTC
I had thought extract_bit_field bitpos argument was the shifted position and not the bitposition like BIT_FIELD_REF so I had removed the code which would use the correct bitposition for BYTES_BIG_ENDIAN. Committed as obvious; I checked big-endian MIPS to make sure we are now producing the correct code. gcc/ChangeLog: * expr.cc (expand_single_bit_test): Correct bitpos for big-endian. --- gcc/expr.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gcc/expr.cc b/gcc/expr.cc index 02f24c00148..050efcd0b00 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -12958,7 +12958,14 @@ expand_single_bit_test (location_t loc, enum tree_code code, rtx inner0 = expand_expr (inner, NULL_RTX, VOIDmode, EXPAND_NORMAL); - inner0 = extract_bit_field (inner0, 1, bitnum, 1, target, + int bitpos = bitnum; + + scalar_int_mode imode = as_a <scalar_int_mode>(GET_MODE (inner0)); + + if (BYTES_BIG_ENDIAN) + bitpos = GET_MODE_BITSIZE (imode) - 1 - bitpos; + + inner0 = extract_bit_field (inner0, 1, bitpos, 1, target, operand_mode, mode, 0, NULL); if (code == EQ_EXPR)