From patchwork Tue Jan 31 06:10:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?556/5LuZ5re8?= X-Patchwork-Id: 50619 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2584031wrn; Mon, 30 Jan 2023 22:11:32 -0800 (PST) X-Google-Smtp-Source: AK7set+eBzww1Aa2gNYEGeFVrPBROpiJZLGownDgnlDyi894T74+MYWJkmnxdaEjwc3InWwugGn4 X-Received: by 2002:a05:6402:35c6:b0:46f:d386:117d with SMTP id z6-20020a05640235c600b0046fd386117dmr2510435edc.33.1675145492718; Mon, 30 Jan 2023 22:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675145492; cv=none; d=google.com; s=arc-20160816; b=O01+e5Gp4z1l7vnBJDX3lSY3Z5QXmw47LttpQg1URVGlU9MIKMkpvOfn2nhQsNlL2s 4pLIH2LTQ7nna07xRUYSuFV/LwLCeHwD1kuPmG9zFld+T5uvBsmu7mENr56X6qpROeGA 56WofkzXzs0adOtUsA3D52c8SI077PYevCp4UP+xYuRUf3Wje1GYDIuIaC4QR4WZvPAg SY/noSAoYIu0ttJIA1M7GHSdfzTqnwnfyq/5tp9ZGGFscHxkkuw7SqoFmJw2eZ5fixkb MQCx1A8IkN6kM1Qs2k/645MVxqqJwuOBBc6UwdCywoKjrvMv25YZWLsZ6K+lSFHTDBys AKBw== 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=QLeAXbIcIbo0wphfkMWC1YrP+enU29Hz5Y7AfmXuwVo=; b=u3WBuvhkKsAF9b7HwtdN9SbfjKCVe1EIZsvVgxLhvnyTu5n+dio7/5i02ZYgGYZ2Q+ MONtpdZRCLZK+wY26S204/9SiK6DEbNxlht3f/zGAIbiw4Ha+4Zfd+uRliy2gkCD/SSs fBonsJB8Eg15AjbOydqc/kro4SbWeKlzHdsMn67UGLdR551JmQRPyTrfVgallgxLNNdw 9p1CqsNCWHIqKuMRj233/y8Z1AYs++f8NFJI6hgJvNqN40y2sdx8mWG37TYY4qridQP6 +nTamebKYYgpexgMJErHhtCqt7afcFxZoytSurRWvkPWET5J1vKAtz2e3SIDyJS4FB1p qFGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=RhQ7FiAd; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n13-20020a05640206cd00b004a21b97228bsi11092943edy.224.2023.01.30.22.11.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 22:11:32 -0800 (PST) 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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=RhQ7FiAd; 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"; 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 A44EB3858D39 for ; Tue, 31 Jan 2023 06:11:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A44EB3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675145491; bh=QLeAXbIcIbo0wphfkMWC1YrP+enU29Hz5Y7AfmXuwVo=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=RhQ7FiAdYwOUdC+lNrBp1mcmHiHOCCplZJzl0If//9mV3jy97NE5aJ1ggF7raIYfx sbef6R4HgHnFpcQnotB0t1awpE/42t0i6MNYFa3m7hQ4FGlhviYez79kFO5XWBV4JH mfjTEDCZ8Eep8pJwZlZ1YZvCy93N6M491XOnYbYo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by sourceware.org (Postfix) with ESMTPS id 9500A3858D28 for ; Tue, 31 Jan 2023 06:10:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9500A3858D28 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R181e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045192; MF=cooper.qu@linux.alibaba.com; NM=1; PH=DS; RN=3; SR=0; TI=SMTPD_---0VaVQoYV_1675145440; Received: from localhost(mailfrom:cooper.qu@linux.alibaba.com fp:SMTPD_---0VaVQoYV_1675145440) by smtp.aliyun-inc.com; Tue, 31 Jan 2023 14:10:40 +0800 To: gcc-patches@gcc.gnu.org, rguenther@suse.de Cc: Xianmiao Qu Subject: [PATCH] testsuite: Fix pr108574-3.c failed in arch where sign defaults to unsigned. Date: Tue, 31 Jan 2023 14:10:38 +0800 Message-Id: <20230131061038.97059-1-cooper.qu@linux.alibaba.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 X-Spam-Status: No, score=-20.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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: , X-Patchwork-Original-From: Xianmiao Qu via Gcc-patches From: =?utf-8?b?556/5LuZ5re8?= Reply-To: Xianmiao Qu 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?1756517360303556200?= X-GMAIL-MSGID: =?utf-8?q?1756517360303556200?= In the architecture where sign defaults to unsigned, the 'f' will be zero extended to int type in the expression 'd = ~(f & ~2880764155)', then the 'd' will become -1 wich cause the case to fail. So it's ok for the architectures where sign defaults to signed like x86, but failed for the architectures where sign defaults to unsigned like arm and csky. Change char to signed char to avoid this problem. gcc/testsuite: * gcc.dg/torture/pr108574-3.c (b, f): Change type from char to signed char. --- gcc/testsuite/gcc.dg/torture/pr108574-3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/torture/pr108574-3.c b/gcc/testsuite/gcc.dg/torture/pr108574-3.c index 3c9146e31ac..b4d5dae9f80 100644 --- a/gcc/testsuite/gcc.dg/torture/pr108574-3.c +++ b/gcc/testsuite/gcc.dg/torture/pr108574-3.c @@ -1,7 +1,7 @@ /* { dg-do run } */ int a = 3557301289, d; -char b, f; +signed char b, f; unsigned short c = 241; short e, g; static void h() {